Changeset 8925
- Timestamp:
- 06/04/07 22:18:55 (19 months ago)
- Files:
-
- 2 modified
-
dijit/trunk/layout/Dialog.js (modified) (9 diffs)
-
dojo/trunk/_base/fx.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/layout/Dialog.js
r8904 r8925 13 13 [dijit.layout.ContentPane, dijit.base.TemplatedWidget], 14 14 { 15 // summary 16 // Pops up a modal dialog window, blocking access to the screen and also graying out the screen 17 // Dialog is extended from ContentPane so it supports all the same parameters (href, etc.) 15 // summary: 16 // Pops up a modal dialog window, blocking access to the screen 17 // and also graying out the screen Dialog is extended from 18 // ContentPane so it supports all the same parameters (href, etc.) 18 19 19 20 templatePath: dojo.moduleUrl("dijit.layout", "templates/Dialog.html"), … … 42 43 43 44 _trapTabs: function(/*Event*/ e){ 44 // summary 45 // callback on focus 46 if(e.target == this.tabStartOuter) { 47 if(this._fromTrap) { 48 this.tabStart.focus(); 49 this._fromTrap = false; 50 } else { 45 // summary: callback on focus 46 if(e.target == this.tabStartOuter){ 47 if(this._fromTrap){ 48 this.tabStart.focus(); 49 this._fromTrap = false; 50 }else{ 51 51 this._fromTrap = true; 52 52 this.tabEnd.focus(); 53 53 } 54 } else if (e.target == this.tabStart){55 if(this._fromTrap) {56 this._fromTrap = false; 57 } else{54 }else if(e.target == this.tabStart){ 55 if(this._fromTrap){ 56 this._fromTrap = false; 57 }else{ 58 58 this._fromTrap = true; 59 59 this.tabEnd.focus(); 60 60 } 61 } else if(e.target == this.tabEndOuter){62 if(this._fromTrap) {61 }else if(e.target == this.tabEndOuter){ 62 if(this._fromTrap){ 63 63 this.tabEnd.focus(); 64 64 this._fromTrap = false; 65 } else { 66 this._fromTrap = true; 67 this.tabStart.focus(); 68 } 69 } else if(e.target == this.tabEnd) { 70 if(this._fromTrap) { 71 this._fromTrap = false; 72 } else { 73 this._fromTrap = true; 74 this.tabStart.focus(); 75 } 76 } 77 }, 78 79 _clearTrap: function(/*Event*/ e) { 80 // summary 81 // callback on blur 82 var _this = this; 83 setTimeout(function() { 84 _this._fromTrap = false; 85 }, 100); 86 }, 87 88 _setup: function() { 89 // summary 90 // stuff we need to do before showing the Dialog for the first time 91 // (but we defer it until right beforehand, for performance reasons) 65 }else{ 66 this._fromTrap = true; 67 this.tabStart.focus(); 68 } 69 }else if(e.target == this.tabEnd){ 70 if(this._fromTrap){ 71 this._fromTrap = false; 72 }else{ 73 this._fromTrap = true; 74 this.tabStart.focus(); 75 } 76 } 77 }, 78 79 _clearTrap: function(/*Event*/ e){ 80 // summary: callback on blur 81 setTimeout(dojo.hitch(this, function(){ 82 this._fromTrap = false; 83 }), 100); 84 }, 85 86 _visibleBgOpacity: 0.4, 87 88 _setup: function(){ 89 // summary: 90 // stuff we need to do before showing the Dialog for the first 91 // time (but we defer it until right beforehand, for 92 // performance reasons) 92 93 93 94 var b = dojo.body(); … … 108 109 this._fadeIn = dojo.fadeIn({ 109 110 node: node, 110 duration: this._duration, 111 onEnd: dojo.hitch(this, "_showBackground") 112 }); 111 duration: this._duration 112 }).combine([ 113 dojo.animateProperty({ 114 node: this.bg, 115 duration: this._duration, 116 onBegin: dojo.hitch(this, "_showBackground"), 117 properties: { 118 opacity: { start: 0, end: this._visibleBgOpacity } 119 } 120 }) 121 ]); 122 113 123 this._fadeOut = dojo.fadeOut({ 114 124 node: node, … … 117 127 node.style.display="none"; 118 128 } 119 }); 129 }).combine([ 130 dojo.fadeOut({ 131 node: this.bg, 132 duration: this._duration 133 }) 134 ]); 120 135 }, 121 136 … … 129 144 }, 130 145 131 _sizeBackground: function() {146 _sizeBackground: function(){ 132 147 // summary 133 148 // Sets the background to the size of the viewport (rather than the size … … 149 164 // by the previous resizing 150 165 viewport = dijit.util.getViewport(); 151 if (viewport.w != w) { this.bg.style.width = viewport.w + "px"; } 152 if (viewport.h != h) { this.bg.style.height = viewport.h + "px"; } 153 }, 154 155 _showBackground: function() { 166 if(viewport.w != w){ this.bg.style.width = viewport.w + "px"; } 167 if(viewport.h != h){ this.bg.style.height = viewport.h + "px"; } 168 }, 169 170 _showBackground: function(){ 171 console.debug("_showBackground"); 156 172 this.bg.style.display = "block"; 157 173 if(this.bgIframe.iframe){ … … 160 176 }, 161 177 162 _center: function() {178 _center: function(){ 163 179 // summary: position modal dialog in center of screen 164 180 … … 181 197 182 198 _onKey: function(/*Event*/ evt){ 183 if (evt.keyCode){199 if(evt.keyCode){ 184 200 // see if the key is for the dialog 185 201 var node = evt.target; 186 202 while (node != null){ 187 if (node == this.domNode){203 if(node == this.domNode){ 188 204 return; // yes, so just let it go 189 205 } … … 195 211 // opera won't tab to a div 196 212 }else if (!dojo.isOpera){ 197 try {213 try{ 198 214 this.tabStart.focus(); 199 } catch(e){}200 } 201 } 202 }, 203 204 show: function() {215 }catch(e){} 216 } 217 } 218 }, 219 220 show: function(){ 205 221 // summary: display the dialog 206 222 -
dojo/trunk/_base/fx.js
r8728 r8925 214 214 combine: function(/*dojo._Animation[]*/ anims){ 215 215 dojo.forEach(anims, function(anim){ 216 dojo.connect(this, "play", anim, "play"); 216 dojo.forEach([ 217 "beforeBegin", "onBegin", "onAnimate", "onEnd", 218 "onPlay", "onPause", "onStop", "play" 219 ], function(evt){ 220 if(anim[evt]){ 221 // if(!this[evt]){ this[evt] = function(){}; } 222 dojo.connect(this, evt, anim, evt); 223 } 224 }, this); 217 225 }, this); 218 226 return this; // dojo._Animation … … 339 347 } 340 348 } 349 this._percent = 0; 341 350 this.fire("onEnd"); 342 351 }