RoundRect.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. define("dojox/mobile/RoundRect", [
  2. "dojo/_base/array",
  3. "dojo/_base/declare",
  4. "dojo/_base/window",
  5. "dijit/_Contained",
  6. "dijit/_Container",
  7. "dijit/_WidgetBase"
  8. ], function(array, declare, win, Contained, Container, WidgetBase){
  9. /*=====
  10. var Contained = dijit._Contained;
  11. var Container = dijit._Container;
  12. var WidgetBase = dijit._WidgetBase;
  13. =====*/
  14. // module:
  15. // dojox/mobile/RoundRect
  16. // summary:
  17. // A simple round rectangle container.
  18. return declare("dojox.mobile.RoundRect", [WidgetBase, Container, Contained], {
  19. // summary:
  20. // A simple round rectangle container.
  21. // description:
  22. // RoundRect is a simple round rectangle container for any HTML
  23. // and/or widgets. You can achieve the same appearance by just
  24. // applying the -webkit-border-radius style to a div tag. However,
  25. // if you use RoundRect, you can get a round rectangle even on
  26. // non-CSS3 browsers such as (older) IE.
  27. // shadow: Boolean
  28. // If true, adds a shadow effect to the container element.
  29. shadow: false,
  30. buildRendering: function(){
  31. this.domNode = this.containerNode = this.srcNodeRef || win.doc.createElement("DIV");
  32. this.domNode.className = this.shadow ? "mblRoundRect mblShadow" : "mblRoundRect";
  33. },
  34. resize: function(){
  35. // summary:
  36. // Calls resize() of each child widget.
  37. array.forEach(this.getChildren(), function(child){
  38. if(child.resize){ child.resize(); }
  39. });
  40. }
  41. });
  42. });