From d6c5e5150119b6fb7b22f67451f71da0c285edbc Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 22 Nov 2014 10:19:03 +0000 Subject: [PATCH] Fix popup handling in Cecily and Zoomin view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cecily and Zoomin story views use a document.body that is smaller than the document.documentElement. We were just clearing the popups on clicks on the document.body Clicks on the document element (ie, on the background of the page) were not being trapped, meaning that you couldn’t dismiss a popup. --- core/modules/startup/startup.js | 4 +--- core/modules/utils/dom/popup.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index 377974ad6..6bdb2e9a9 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -78,9 +78,7 @@ exports.startup = function() { // Host-specific startup if($tw.browser) { // Install the popup manager - $tw.popup = new $tw.utils.Popup({ - rootElement: document.body - }); + $tw.popup = new $tw.utils.Popup(); // Install the animator $tw.anim = new $tw.utils.Animator(); } diff --git a/core/modules/utils/dom/popup.js b/core/modules/utils/dom/popup.js index c29ad5400..7ee405d20 100644 --- a/core/modules/utils/dom/popup.js +++ b/core/modules/utils/dom/popup.js @@ -18,7 +18,7 @@ Creates a Popup object with these options: */ var Popup = function(options) { options = options || {}; - this.rootElement = options.rootElement || document.body; + this.rootElement = options.rootElement || document.documentElement; this.popups = []; // Array of {title:,wiki:,domNode:} objects };