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

Unified Diff: safari/ext/popup.js

Issue 6476185965953024: Adjust the size of the bubble to the size of its content in Safari (Closed)
Patch Set: Created Dec. 24, 2013, 12:42 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 | « metadata.safari ('k') | 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
@@ -21,3 +21,12 @@
{
safari.self.hide();
}, true);
+
+// Safari doesn't adjust the size of the popover automatically to the size of
+// its content, like when the ad counter is expanded/collapsed. So we add an
+// event listener to do so.
+document.addEventListener("DOMSubtreeModified", function()
+{
+ safari.self.width = document.body.offsetWidth;
+ safari.self.height = document.body.offsetHeight;
Wladimir Palant 2014/01/15 15:47:13 What about document.documentElement.offsetWidth/He
Sebastian Noack 2014/01/15 17:21:52 No, it doesn't has the right value (sometimes?). D
+});
« no previous file with comments | « metadata.safari ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld