Chromium Code Reviews| Index: ui/webui/resources/js/cr/ui/page_manager/page_manager.js |
| diff --git a/ui/webui/resources/js/cr/ui/page_manager/page_manager.js b/ui/webui/resources/js/cr/ui/page_manager/page_manager.js |
| index 6f9f1cce3ffe6bd8bccb1c84cb3e3a46d359816e..e312b909f7aa0e0f11b76d6342289a4a4712c50a 100644 |
| --- a/ui/webui/resources/js/cr/ui/page_manager/page_manager.js |
| +++ b/ui/webui/resources/js/cr/ui/page_manager/page_manager.js |
| @@ -193,7 +193,7 @@ cr.define('cr.ui.pageManager', function() { |
| this.registeredOverlayPages[name]; |
| if (!page.parentPage && isRootPageLocked) |
| continue; |
| - if (page.willHidePage && name != pageName && |
| + if (page.visible && name != pageName && |
|
Dan Beam
2014/08/13 02:50:46
why did you add this visibility check?
michaelpg
2014/08/13 08:12:11
because this doesn't match the comment: "notify pa
|
| !this.isAncestorOfPage(page, targetPage)) { |
| page.willHidePage(); |
| } |
| @@ -228,7 +228,7 @@ cr.define('cr.ui.pageManager', function() { |
| this.registeredOverlayPages[name]; |
| if (!page.parentPage && isRootPageLocked) |
| continue; |
| - if (!targetPageWasVisible && page.didShowPage && |
| + if (!targetPageWasVisible && |
| (name == pageName || this.isAncestorOfPage(page, targetPage))) { |
| page.didShowPage(); |
| } |
| @@ -305,8 +305,9 @@ cr.define('cr.ui.pageManager', function() { |
| onPageVisibilityChanged: function(page) { |
| this.updateRootPageFreezeState(); |
| - for (var i = 0; i < this.observers_.length; ++i) |
| + for (var i = 0; i < this.observers_.length; ++i) { |
| this.observers_[i].onPageVisibilityChanged(page); |
| + } |
| if (!page.visible && this.isTopLevelOverlay(page)) |
| this.updateScrollPosition_(); |
| @@ -332,9 +333,8 @@ cr.define('cr.ui.pageManager', function() { |
| return; |
| overlay.visible = false; |
| + overlay.didClosePage(); |
| - if (overlay.didClosePage) |
| - overlay.didClosePage(); |
| this.updateHistoryState_(false, {ignoreHash: true}); |
| this.updateTitle_(); |
| @@ -420,7 +420,7 @@ cr.define('cr.ui.pageManager', function() { |
| this.defaultPage_; |
| if (currentOverlay && !this.isAncestorOfPage(currentOverlay, newPage)) { |
| currentOverlay.visible = false; |
| - if (currentOverlay.didClosePage) currentOverlay.didClosePage(); |
| + currentOverlay.didClosePage(); |
| } |
| this.showPageByName(pageName, false); |
| }, |
| @@ -440,7 +440,7 @@ cr.define('cr.ui.pageManager', function() { |
| */ |
| willClose: function() { |
| var overlay = this.getVisibleOverlay_(); |
| - if (overlay && overlay.didClosePage) |
| + if (overlay) |
| overlay.didClosePage(); |
| }, |
| @@ -495,8 +495,7 @@ cr.define('cr.ui.pageManager', function() { |
| if (!overlay.visible) { |
| overlay.visible = true; |
| - if (overlay.didShowPage) |
| - overlay.didShowPage(); |
| + overlay.didShowPage(); |
| } |
| // Change focus to the overlay if any other control was focused by |