OLD | NEW |
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; |
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 Loading... |
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 })(); |
OLD | NEW |