Opened 13 years ago
Closed 13 years ago
#5190 closed defect (fixed)
[patch/cla] nodes underneath toaster become inaccessible
Reported by: | guest | Owned by: | dante |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dojox | Version: | 1.0 |
Keywords: | toaster | Cc: | |
Blocked By: | Blocking: |
Description
After toaster displaying and hiding all nodes under toaster become inaccessible. For example, I cannot enter <input/> if toaster was displayed over it. Problem in toaster domNode - it remains visible after toaster hided (only containerNode hides). This simple patch will correct this problem
Index: dojox/widget/Toaster.js =================================================================== --- dojox/widget/Toaster.js (revision 11576) +++ dojox/widget/Toaster.js (working copy) @@ -222,7 +222,7 @@ show: function(){ // summary: show the Toaster - dojo.style(this.containerNode, 'display', ''); + dojo.style(this.domNode, 'display', 'block'); this._placeClip(); @@ -235,7 +235,7 @@ // summary: hide the Toaster //Q: ALP: I didn't port all the toggler stuff from d.w.HtmlWidget. Is it needed? Ditto for show. - dojo.style(this.containerNode, 'display', 'none'); + dojo.style(this.domNode, 'display', 'none'); if(this._scrollConnected){ dojo.disconnect(this._scrollConnected);
Attachments (1)
Change History (6)
comment:1 Changed 13 years ago by
Owner: | changed from Tom Trenka to Adam Peller |
---|---|
Summary: | [toaster] → nodes underneath toaster become inaccessible |
comment:2 Changed 13 years ago by
Vladimir Solomenchuk/cla following patch fixes:
- access to nodes nodes under tooltip
- it case of duration==0, toaster remains displayed after adding messages with duration!=0
- toaster hides after click in case of duration!=0
Index: widget/Toaster.js =================================================================== --- widget/Toaster.js (revision 11840) +++ widget/Toaster.js (working copy) @@ -92,7 +92,7 @@ } if(this.slideAnim.status() == "playing" || (this.fadeAnim && this.fadeAnim.status() == "playing")){ setTimeout(dojo.hitch(this, function(){ - this.setContent(message, messageType); + this.setContent(message, messageType, duration); }), 50); return; } @@ -120,9 +120,13 @@ // bottom right of page and up this.show(); var nodeSize = dojo.marginBox(this.containerNode); - + this._cancelHideTimer(); if(this.isVisible){ this._placeClip(); + //update hide timer if no sticky message in stack + if (!this._stickyMessage) + this._setHideTimer(duration); + }else{ var style = this.containerNode.style; var pd = this.positionDirection; @@ -142,7 +146,6 @@ }else{ throw new Error(this.id + ".positionDirection is invalid: " + pd); } - this.slideAnim = dojo.fx.slideTo({ node: this.containerNode, top: 0, left: 0, @@ -158,22 +161,14 @@ this.isVisible = false; this.hide(); }); - //if duration == 0 we keep the message displayed until clicked - //TODO: fix so that if a duration > 0 is displayed when a duration==0 is appended to it, the fadeOut is canceled - if(duration>0){ - setTimeout(dojo.hitch(this, function(evt){ - // we must hide the iframe in order to fade - // TODO: figure out how to fade with a BackgroundIframe - if(this.bgIframe && this.bgIframe.iframe){ - this.bgIframe.iframe.style.display="none"; - } - this.fadeAnim.play(); - }), duration); - }else{ - dojo.connect(this, 'onSelect', this, function(evt){ - this.fadeAnim.play(); - }); - } + this._setHideTimer(duration); + dojo.connect(this, 'onSelect', this, function(evt){ + this._cancelHideTimer(); + //force clear sticky message + this._stickyMessage=false; + this.fadeAnim.play(); + }); + this.isVisible = true; }); this.slideAnim.play(); @@ -179,7 +174,32 @@ this.slideAnim.play(); } }, - + _cancelHideTimer:function(){ + if (this._hideTimer){ + clearTimeout(this._hideTimer); + this._hideTimer=null; + } + }, + _setHideTimer:function(duration){ + this._cancelHideTimer(); + //if duration == 0 we keep the message displayed until clicked + if(duration>0){ + this._cancelHideTimer(); + this._hideTimer=setTimeout(dojo.hitch(this, function(evt){ + // we must hide the iframe in order to fade + // TODO: figure out how to fade with a BackgroundIframe + if(this.bgIframe && this.bgIframe.iframe){ + this.bgIframe.iframe.style.display="none"; + } + this._hideTimer=null; + //force clear sticky message + this._stickyMessage=false; + this.fadeAnim.play(); + }), duration); + } + else + this._stickyMessage=true; + }, _placeClip: function(){ var view = dijit.getViewport(); @@ -222,7 +242,7 @@ show: function(){ // summary: show the Toaster - dojo.style(this.containerNode, 'display', ''); + dojo.style(this.domNode, 'display', 'block'); this._placeClip(); @@ -235,7 +255,7 @@ // summary: hide the Toaster //Q: ALP: I didn't port all the toggler stuff from d.w.HtmlWidget. Is it needed? Ditto for show. - dojo.style(this.containerNode, 'display', 'none'); + dojo.style(this.domNode, 'display', 'none'); if(this._scrollConnected){ dojo.disconnect(this._scrollConnected);
comment:3 Changed 13 years ago by
Owner: | changed from Adam Peller to dante |
---|
comment:4 Changed 13 years ago by
Summary: | nodes underneath toaster become inaccessible → [patch/cla] nodes underneath toaster become inaccessible |
---|
great thanks! in the future though, it's tons easier if you use the 'attach file' to attach your patch (eliminates the chance of a paste error, line breaks, etc, and also makes highlighted diffs, and can download the .diff without effort) ... thanks again. will review.
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
thanks for the patch. va test case would be helpful.