Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/popup.js

Issue 5083364310646784: Got rid of strange animation when the bubble is resized while reloading on Safari (Closed)
Patch Set: Created Jan. 16, 2014, 11:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/popup.js
===================================================================
--- a/safari/ext/popup.js
+++ b/safari/ext/popup.js
@@ -9,11 +9,13 @@
var backgroundPage = safari.extension.globalPage.contentWindow;
var readyState = backgroundPage.document.readyState;
var activeTab = safari.application.activeBrowserWindow.activeTab;
+ var stopResizing = function() {};
safari.self.addEventListener("popover", function()
{
if (activeTab != safari.application.activeBrowserWindow.activeTab || readyState != "complete")
{
+ stopResizing();
document.documentElement.style.display = "none";
document.location.reload();
}
@@ -36,13 +38,26 @@
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
if (MutationObserver)
{
- new MutationObserver(updateSize).observe(document, {
+ var mo = new MutationObserver(updateSize);
+ mo.observe(document, {
childList: true, attributes: true,
characterData: true, subtree: true
});
+
+ stopResizing = function()
+ {
+ mo.disconnect();
+ };
}
else
+ {
document.addEventListener("DOMSubtreeModified", updateSize);
+
+ stopResizing = function()
+ {
+ document.removeEventListener("DOMSubtreeModified", updateSize);
+ };
+ }
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld