Changeset 8799

Show
Ignore:
Timestamp:
05/29/07 09:03:34 (20 months ago)
Author:
doughays
Message:

Fixes #3168. Proxy commit for haysmark.
Removed dijit.form_DropDownTextBox.Popup.

Location:
dijit/trunk/form
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/form/AutoCompleter.js

    r8749 r8799  
    443443dojo.declare( 
    444444        "dijit.form._AutoCompleterMenu", 
    445         [dijit.base.FormElement, dijit.base.TemplatedWidget, dijit.form._DropDownTextBox.Popup], 
     445        [dijit.base.FormElement, dijit.base.TemplatedWidget], 
    446446 
    447447// Bill:  
     
    475475                        // summary: 
    476476                        //      call all postCreates 
    477                         dijit.form._DropDownTextBox.Popup.prototype.postCreate.apply(this, arguments); 
    478477                        dijit.base.FormElement.prototype.postCreate.apply(this, arguments); 
    479478                }, 
     
    482481                        this.maxListLength=widget.maxListLength; 
    483482                        this.onValueChanged=dojo.hitch(widget, widget._selectOption); 
    484                         dijit.form._DropDownTextBox.Popup.prototype.open.apply(this, arguments); 
     483                        dijit.util.PopupManager.openAround(widget.textbox, this); 
    485484                }, 
    486485 
    487486                close:function(){ 
    488                         dijit.form._DropDownTextBox.Popup.prototype.close.apply(this, arguments); 
    489487                        this._blurOptionNode(); 
    490488                }, 
  • dijit/trunk/form/DateTextbox.js

    r8733 r8799  
    2121                parse: dojo.date.locale.parse, 
    2222                value: new Date(), 
    23                 _popupClass:"dijit._CalendarPopup", 
     23                _popupClass:"dijit._Calendar", 
    2424 
    2525                postMixInProperties: function(){ 
     
    4040                        //      Sets the date on this textbox 
    4141 
    42                         if(!this._popupWidget||this._popupWidget.parentWidget!=this){ 
     42                        if(!this._popupWidget||!this._popupWidget.onValueSelected){ 
    4343                                dijit.form.DateTextbox.superclass.setValue.apply(this, arguments); 
    4444                        }else{ 
     
    4949                postCreate:function(){ 
    5050                        dijit.form.DateTextbox.superclass.postCreate.apply(this, arguments); 
    51                         // #3000: set popupArgs here so Calendar gets the widget's lang, not the user's lang 
    52                         // TODO: move popup code inside here 
    53                         this._popupArgs={lang:this.lang}; 
     51                        this._popupArgs={ 
     52                                // #3000: set popupArgs here so Calendar gets the widget's lang, not the user's lang 
     53                                lang:this.lang, 
     54 
     55                                open:function(/*Widget*/ widget){ 
     56                                        // summary: 
     57                                        //      opens the Calendar, and sets the onValueSelected for the Calendar 
     58 
     59                                        this.constraints=widget.constraints; 
     60                                        this.setValue(widget.getValue()); 
     61                                        this.onValueSelected=dojo.hitch(widget, widget._calendarOnValueSelected); 
     62                                        dijit.util.PopupManager.openAround(widget.textbox, this); 
     63                                }, 
     64 
     65                                isDisabledDate:function(/*Date*/ date){ 
     66                                        // summary: 
     67                                        //      disables dates outside of the min/max of the DateTextbox 
     68                                        return(this.constraints!=null&&(dojo.date.compare(this.constraints.min,date)>0||dojo.date.compare(this.constraints.max,date)<0)); 
     69                                } 
     70                        }; 
    5471                        // convert the arrow image from using style.background-image to the .src property (a11y) 
    5572                        dijit.util.wai.imageBgToSrc(this.arrowImage); 
     
    6380        } 
    6481); 
    65  
    66 dojo.declare( 
    67         "dijit._CalendarPopup", 
    68         [dijit._Calendar, dijit.form._DropDownTextBox.Popup], 
    69         { 
    70                 postCreate:function(){ 
    71                         // summary: 
    72                         //      call all postCreates 
    73                         dijit._Calendar.prototype.postCreate.apply(this, arguments); 
    74                         dijit.form._DropDownTextBox.Popup.prototype.postCreate.apply(this, arguments); 
    75                 }, 
    76  
    77                 open:function(/*Widget*/ widget){ 
    78                         // summary: 
    79                         //      opens the menu, and sets the onValueSelected for the Calendar 
    80          
    81                         dijit.form._DropDownTextBox.Popup.prototype.open.apply(this, arguments); 
    82                         this.constraints=widget.constraints; 
    83                         this.setValue(widget.getValue()); 
    84                         this.onValueSelected=dojo.hitch(widget, widget._calendarOnValueSelected); 
    85                 }, 
    86  
    87                 close:function(){ 
    88                         dijit.form._DropDownTextBox.Popup.prototype.close.apply(this, arguments); 
    89                         this.constraints=null; 
    90                 }, 
    91  
    92                 isDisabledDate:function(/*Date*/ date){ 
    93                         // summary: 
    94                         //      disables dates outside of the min/max of the DateTextbox 
    95                         return(this.constraints!=null&&(dojo.date.compare(this.constraints.min,date)>0||dojo.date.compare(this.constraints.max,date)<0)); 
    96                 } 
    97         } 
    98 ); 
  • dijit/trunk/form/_DropDownTextBox.js

    r8776 r8799  
    5757                                var node=document.createElement("div"); 
    5858                                document.body.appendChild(node); 
     59                                // If you leave display="", _DropDownTextBox will think that the popup is open. 
     60                                // _DropDownTextBox will call PopupManager.close() to close its last popup. 
     61                                // However, because this popup was never popped up,  
     62                                // PopupManager has an empty popup stack and creates an error. 
     63                                // Setting display="none" prevents this bad call to PopupManager.close(). 
     64                                with(node.style){ 
     65                                        display="none"; 
     66                                        position="absolute"; 
     67                                        overflow="auto"; 
     68                                } 
    5969                                var popupProto=dojo.getObject(_this._popupClass, false); 
    6070                                return new popupProto(_this._popupArgs, node); 
     
    8696                        this.focus(); 
    8797                        this.makePopup(); 
    88                         if(this._popupWidget.isShowingNow()){ 
     98                        if(this.isShowingNow()){ 
    8999                                this._hideResultList(); 
    90100                        }else{ 
     
    96106 
    97107                _hideResultList: function(){ 
    98                         if(this._popupWidget&&(!this._popupWidget.isShowingNow||this._popupWidget.isShowingNow())){ 
     108                        if(this.isShowingNow()){ 
    99109                                dijit.util.PopupManager.close(true); 
    100110                                this._arrowIdle(); 
     
    205215                        // summary 
    206216                        //      test if the popup is visible 
    207                         return this._popupWidget&&this._popupWidget.isShowingNow(); 
     217                        return this._popupWidget&&this._popupWidget.domNode.style.display!="none"; 
    208218                }, 
    209219 
     
    221231        } 
    222232); 
    223  
    224  dojo.declare( 
    225         "dijit.form._DropDownTextBox.Popup", 
    226         null, 
    227         { 
    228                 // summary: 
    229                 //      Mixin that provides basic open/close behavior for popup widgets 
    230  
    231                 // parentWidget: Widget 
    232                 //      Reference to parent widget 
    233                 parentWidget:null, 
    234  
    235                 postCreate:function(){ 
    236                         // FIXME: create an external template so template style isn't displaced 
    237                         this.domNode.style.display="none"; 
    238                         this.domNode.style.overflow="auto"; 
    239                         this.domNode.style.position="absolute"; 
    240                 }, 
    241  
    242                 open:function(/*Widget*/ widget){ 
    243                         // summary: 
    244                         //      opens the menu 
    245  
    246                         this.parentWidget=widget; 
    247                         setTimeout(dojo.hitch(this, function(){dijit.util.PopupManager.openAround(widget.textbox, this);}), 1); 
    248                 }, 
    249  
    250                 isShowingNow:function(){ 
    251                         return this.domNode.style.display!="none"; 
    252                 }, 
    253  
    254                 close: function(/*Boolean*/ force){ 
    255                         // summary: 
    256                         //      closes the menu 
    257  
    258                         if(!this.isShowingNow()){ 
    259                                 return; 
    260                         } 
    261                         this.onValueChanged=function(){ 
    262                                 return; 
    263                         }; 
    264                         this.parentWidget=null; 
    265                 } 
    266         } 
    267 );