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

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

Issue 5192042284056576: Hide bubble when opening options page in Safari (Closed)
Patch Set: Added missing bracket Created Dec. 24, 2013, 10:49 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 with (safari.extension.globalPage.contentWindow) 1 with (safari.extension.globalPage.contentWindow)
2 { 2 {
3 this.ext = ext; 3 this.ext = ext;
4 this.TabMap = TabMap; 4 this.TabMap = TabMap;
5 } 5 }
6 6
7 // Safari will load the popover once, and then show it everytime the icon is 7 // Safari will load the popover once, and then show it everytime the icon is
8 // clicked. While Chrome loads it everytime you click the icon. So in order to 8 // clicked. While Chrome loads it everytime you click the icon. So in order to
9 // force the same behavior in Safari, we are going to reload the page of the 9 // force the same behavior in Safari, we are going to reload the page of the
10 // bubble everytime it is shown. 10 // bubble everytime it is shown.
11 safari.application.addEventListener("popover", function() 11 safari.application.addEventListener("popover", function()
12 { 12 {
13 document.documentElement.style.display = "none"; 13 document.documentElement.style.display = "none";
14 document.location.reload(); 14 document.location.reload();
15 }, true); 15 }, true);
16
17 // Safari doesn't hide popovers automatically, when we change the active tab
18 // programmatically, like when the options link is clicked. So we add an event
19 // listener to do so.
20 safari.application.addEventListener("activate", function()
21 {
22 safari.self.hide();
23 }, true);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld