[483] | 1 | define([ |
---|
| 2 | "dojo/_base/declare", |
---|
| 3 | "dojo/_base/lang", |
---|
| 4 | "dojo/dom-style", |
---|
| 5 | "dojo/dom-class", |
---|
| 6 | "dojo/fx", |
---|
| 7 | "dijit/_Container", |
---|
| 8 | "dijit/layout/ContentPane" |
---|
| 9 | ], function(declare, lang, domStyle, domClass, fx, _Container, ContentPane){ |
---|
| 10 | |
---|
| 11 | return declare("dojox.widget.PortletSettings", [_Container, ContentPane], { |
---|
| 12 | // summary: |
---|
| 13 | // A settings widget to be used with a dojox.widget.Portlet. |
---|
| 14 | // description: |
---|
| 15 | // This widget should be placed inside a dojox.widget.Portlet widget. |
---|
| 16 | // It is used to set some preferences for that Portlet. It is essentially |
---|
| 17 | // a ContentPane, and should contain other widgets and DOM nodes that |
---|
| 18 | // do the real work of setting preferences for the portlet. |
---|
| 19 | |
---|
| 20 | // portletIconClass: String |
---|
| 21 | // The CSS class to apply to the icon in the Portlet title bar that is used |
---|
| 22 | // to toggle the visibility of this widget. |
---|
| 23 | portletIconClass: "dojoxPortletSettingsIcon", |
---|
| 24 | |
---|
| 25 | // portletIconHoverClass: String |
---|
| 26 | // The CSS class to apply to the icon in the Portlet title bar that is used |
---|
| 27 | // to toggle the visibility of this widget when the mouse hovers over it. |
---|
| 28 | portletIconHoverClass: "dojoxPortletSettingsIconHover", |
---|
| 29 | |
---|
| 30 | postCreate: function(){ |
---|
| 31 | // summary: |
---|
| 32 | // Sets the require CSS classes on the widget. |
---|
| 33 | |
---|
| 34 | // Start the PortletSettings widget hidden, always. |
---|
| 35 | domStyle.set(this.domNode, "display", "none"); |
---|
| 36 | domClass.add(this.domNode, "dojoxPortletSettingsContainer"); |
---|
| 37 | |
---|
| 38 | // Remove the unwanted content pane class. |
---|
| 39 | domClass.remove(this.domNode, "dijitContentPane"); |
---|
| 40 | }, |
---|
| 41 | |
---|
| 42 | _setPortletAttr: function(portlet){ |
---|
| 43 | // summary: |
---|
| 44 | // Sets the portlet that encloses this widget. |
---|
| 45 | this.portlet = portlet; |
---|
| 46 | }, |
---|
| 47 | |
---|
| 48 | toggle: function(){ |
---|
| 49 | // summary: |
---|
| 50 | // Toggles the visibility of this widget. |
---|
| 51 | var n = this.domNode; |
---|
| 52 | if(domStyle.get(n, "display") == "none"){ |
---|
| 53 | domStyle.set(n,{ |
---|
| 54 | "display": "block", |
---|
| 55 | "height": "1px", |
---|
| 56 | "width": "auto" |
---|
| 57 | }); |
---|
| 58 | fx.wipeIn({ |
---|
| 59 | node: n |
---|
| 60 | }).play(); |
---|
| 61 | }else{ |
---|
| 62 | fx.wipeOut({ |
---|
| 63 | node: n, |
---|
| 64 | onEnd: lang.hitch(this, function(){ |
---|
| 65 | domStyle.set(n,{"display": "none", "height": "", "width":""}); |
---|
| 66 | } |
---|
| 67 | )}).play(); |
---|
| 68 | } |
---|
| 69 | } |
---|
| 70 | }); |
---|
| 71 | |
---|
| 72 | }); |
---|