source: Dev/trunk/src/client/dojox/widget/PortletDialogSettings.js @ 532

Last change on this file since 532 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1define([
2        "dojo/_base/declare",
3        "dojo/_base/window",
4        "dojo/dom-style",
5        "./PortletSettings",
6        "dijit/Dialog"
7        ], function(declare, window, domStyle, PortletSettings, Dialog){
8               
9        return declare("dojox.widget.PortletDialogSettings", [PortletSettings],{
10                        // summary:
11                        //              A settings widget to be used with a dojox.widget.Portlet, which displays
12                        //              the contents of this widget in a dijit.Dialog box.
13
14                        // dimensions: Array
15                        //              The size of the dialog to display.      This defaults to [300, 300]
16                        dimensions: null,
17
18                        constructor: function(props, node){
19                                this.dimensions = props.dimensions || [300, 100];
20                        },
21
22                        toggle: function(){
23                                // summary:
24                                //              Shows and hides the Dialog box.
25                               
26                                if(!this.dialog){
27                                        //require("dijit.Dialog");
28                                        this.dialog = new Dialog({title: this.title});
29
30                                        window.body().appendChild(this.dialog.domNode);
31
32                                        // Move this widget inside the dialog
33                                        this.dialog.containerNode.appendChild(this.domNode);
34
35                                        domStyle.set(this.dialog.domNode,{
36                                                "width" : this.dimensions[0] + "px",
37                                                "height" : this.dimensions[1] + "px"
38                                        });
39                                        domStyle.set(this.domNode, "display", "");
40                                }
41                                if(this.dialog.open){
42                                        this.dialog.hide();
43                                }else{
44                                        this.dialog.show(this.domNode);
45                                }
46                        }
47        });
48});
Note: See TracBrowser for help on using the repository browser.