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

Side by Side Diff: safari/ext/popup.js

Issue 5183241912844288: Issue 380 - Fixed width of bubble in Safari with long translated texts (Closed)
Patch Set: Created April 26, 2014, 1:34 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« popup.html ('K') | « popup.html ('k') | skin/popup.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 (function() 1 (function()
2 { 2 {
3 // Safari doesn't adjust the size of the popover automatically to the size 3 // Safari doesn't adjust the size of the popover automatically to the size
4 // of its content, like when the ad counter is expanded/collapsed. So we add 4 // of its content, like when the ad counter is expanded/collapsed. So we add
5 // event listeners to do so. 5 // event listeners to do so.
6 var mayResize = true; 6 var mayResize = true;
7 var resizingScheduled = false; 7 var resizingScheduled = false;
8 8
9 var updateSize = function() 9 var updateSize = function()
10 { 10 {
11 if (mayResize && !resizingScheduled) 11 if (mayResize && !resizingScheduled)
12 { 12 {
13 setTimeout(function() 13 setTimeout(function()
14 { 14 {
15 safari.self.width = document.body.offsetWidth; 15 safari.self.width = document.body.scrollWidth;
Sebastian Noack 2014/04/26 13:39:37 Safari doesn't count overflowing text caused by "w
16 safari.self.height = document.body.offsetHeight; 16 safari.self.height = document.body.offsetHeight;
17 17
18 resizingScheduled = false; 18 resizingScheduled = false;
19 }, 0); 19 }, 0);
20 20
21 resizingScheduled = true; 21 resizingScheduled = true;
22 } 22 }
23 }; 23 };
24 24
25 window.addEventListener("load", function() 25 window.addEventListener("load", function()
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // the reloading code above. 65 // the reloading code above.
66 window.ext = { 66 window.ext = {
67 __proto__: safari.extension.globalPage.contentWindow.ext, 67 __proto__: safari.extension.globalPage.contentWindow.ext,
68 68
69 closePopup: function() 69 closePopup: function()
70 { 70 {
71 safari.self.hide(); 71 safari.self.hide();
72 } 72 }
73 }; 73 };
74 })(); 74 })();
OLDNEW
« popup.html ('K') | « popup.html ('k') | skin/popup.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld