aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/popup/popup.reel/popup.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/ui/popup/popup.reel/popup.js')
-rwxr-xr-xnode_modules/montage/ui/popup/popup.reel/popup.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/node_modules/montage/ui/popup/popup.reel/popup.js b/node_modules/montage/ui/popup/popup.reel/popup.js
index d0a7a1cc..84f845db 100755
--- a/node_modules/montage/ui/popup/popup.reel/popup.js
+++ b/node_modules/montage/ui/popup/popup.reel/popup.js
@@ -175,6 +175,11 @@ var Popup = exports.Popup = Montage.create(Component, { /** @lends module:"modul
175 175
176 } 176 }
177 }, 177 },
178
179 focusOnShow: {
180 value: true
181 },
182
178/** 183/**
179 Description TODO 184 Description TODO
180 @function 185 @function
@@ -365,13 +370,12 @@ var Popup = exports.Popup = Montage.create(Component, { /** @lends module:"modul
365 hide: { 370 hide: {
366 value: function() { 371 value: function() {
367 //console.log('popup hide', this.element); 372 //console.log('popup hide', this.element);
368 this._removeEventListeners();
369
370 var type = this.type, 373 var type = this.type,
371 self = this; 374 self = this;
372 375
373 this.application.getPopupSlot(type, this, function(slot) { 376 this.application.getPopupSlot(type, this, function(slot) {
374 self.application.returnPopupSlot(type); 377 self._removeEventListeners();
378 //self.application.returnPopupSlot(type);
375 self.displayed = false; 379 self.displayed = false;
376 }); 380 });
377 } 381 }
@@ -395,7 +399,7 @@ var Popup = exports.Popup = Montage.create(Component, { /** @lends module:"modul
395 // look to see if any content is a modal 399 // look to see if any content is a modal
396 var i, len = activePopups.length; 400 var i, len = activePopups.length;
397 for(i=0; i< len; i++) { 401 for(i=0; i< len; i++) {
398 if(activePopups[i].content && activePopups[i].content.modal === true) { 402 if(activePopups[i].content && activePopups[i].content.modal === true && activePopups[i].content.displayed === true) {
399 count++; 403 count++;
400 } 404 }
401 } 405 }
@@ -461,7 +465,9 @@ var Popup = exports.Popup = Montage.create(Component, { /** @lends module:"modul
461 465
462 this._positionPopup(); 466 this._positionPopup();
463 // focus the content to enable key events such as ENTER/ESC 467 // focus the content to enable key events such as ENTER/ESC
464 this.content.element.focus(); 468 if(this.focusOnShow === true) {
469 this.content.element.focus();
470 }
465 471
466 } else { 472 } else {
467 if(this.modal === true) { 473 if(this.modal === true) {