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

Side by Side Diff: popup.js

Issue 5768552254537728: Fixed: Popup in Safari won't open after closing it programmatically (Closed)
Patch Set: Created Jan. 16, 2014, 3:26 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
« no previous file with comments | « chrome/ext/popup.js ('k') | safari/ext/popup.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 refreshIconAndContextMenu(tab); 111 refreshIconAndContextMenu(tab);
112 } 112 }
113 113
114 function activateClickHide() 114 function activateClickHide()
115 { 115 {
116 document.body.classList.add("clickhide-active"); 116 document.body.classList.add("clickhide-active");
117 tab.sendMessage({type: "clickhide-activate"}); 117 tab.sendMessage({type: "clickhide-activate"});
118 118
119 // Close the popup after a few seconds, so user doesn't have to 119 // Close the popup after a few seconds, so user doesn't have to
120 activateClickHide.timeout = window.setTimeout(window.close, 5000); 120 activateClickHide.timeout = window.setTimeout(ext.closePopup, 5000);
121 } 121 }
122 122
123 function cancelClickHide() 123 function cancelClickHide()
124 { 124 {
125 if (activateClickHide.timeout) 125 if (activateClickHide.timeout)
126 { 126 {
127 window.clearTimeout(activateClickHide.timeout); 127 window.clearTimeout(activateClickHide.timeout);
128 activateClickHide.timeout = null; 128 activateClickHide.timeout = null;
129 } 129 }
130 document.body.classList.remove("clickhide-active"); 130 document.body.classList.remove("clickhide-active");
131 tab.sendMessage({type: "clickhide-deactivate"}); 131 tab.sendMessage({type: "clickhide-deactivate"});
132 } 132 }
133 133
134 function toggleCollapse(event) 134 function toggleCollapse(event)
135 { 135 {
136 var collapser = event.currentTarget; 136 var collapser = event.currentTarget;
137 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option]; 137 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option];
138 collapser.parentNode.classList.toggle("collapsed"); 138 collapser.parentNode.classList.toggle("collapsed");
139 } 139 }
OLDNEW
« no previous file with comments | « chrome/ext/popup.js ('k') | safari/ext/popup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld