LEFT | RIGHT |
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-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 if (!icon) | 1069 if (!icon) |
1070 return; | 1070 return; |
1071 | 1071 |
1072 let state = (Prefs.enabled ? "active" : "disabled"); | 1072 let state = (Prefs.enabled ? "active" : "disabled"); |
1073 if (state == "active") | 1073 if (state == "active") |
1074 { | 1074 { |
1075 let location = this.getCurrentLocation(window); | 1075 let location = this.getCurrentLocation(window); |
1076 if (location && Policy.isWhitelisted(location.spec)) | 1076 if (location && Policy.isWhitelisted(location.spec)) |
1077 state = "whitelisted"; | 1077 state = "whitelisted"; |
1078 } | 1078 } |
1079 | 1079 |
| 1080 let popupId = "abp-status-popup"; |
1080 if (icon.localName == "statusbarpanel") | 1081 if (icon.localName == "statusbarpanel") |
1081 { | 1082 { |
1082 if (Prefs.defaultstatusbaraction == 0) | 1083 if (Prefs.defaultstatusbaraction == 0) |
1083 icon.setAttribute("popup", icon.getAttribute("context")); | 1084 { |
| 1085 icon.setAttribute("popup", popupId); |
| 1086 icon.removeAttribute("context"); |
| 1087 } |
1084 else | 1088 else |
| 1089 { |
1085 icon.removeAttribute("popup"); | 1090 icon.removeAttribute("popup"); |
| 1091 icon.setAttribute("context", popupId); |
| 1092 } |
1086 } | 1093 } |
1087 else | 1094 else |
1088 { | 1095 { |
1089 if (Prefs.defaulttoolbaraction == 0) | 1096 if (Prefs.defaulttoolbaraction == 0) |
1090 { | 1097 { |
1091 icon.setAttribute("type", "menu"); | 1098 icon.setAttribute("type", "menu"); |
1092 icon.removeAttribute("context"); | 1099 icon.removeAttribute("context"); |
1093 } | 1100 } |
1094 else | 1101 else |
1095 { | 1102 { |
1096 icon.setAttribute("type", "menu-button"); | 1103 icon.setAttribute("type", "menu-button"); |
1097 icon.setAttribute("context", "abp-status-popup"); | 1104 icon.setAttribute("context", popupId); |
1098 } | 1105 } |
1099 } | 1106 } |
1100 | 1107 |
1101 icon.setAttribute("abpstate", state); | 1108 icon.setAttribute("abpstate", state); |
1102 }, | 1109 }, |
1103 | 1110 |
1104 /** | 1111 /** |
1105 * Shows or hides status bar icons in all windows, according to pref. | 1112 * Shows or hides status bar icons in all windows, according to pref. |
1106 */ | 1113 */ |
1107 updateStatusbarIcon: function(/**Window*/ window) | 1114 updateStatusbarIcon: function(/**Window*/ window) |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], | 1933 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], |
1927 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] | 1934 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] |
1928 ]; | 1935 ]; |
1929 | 1936 |
1930 onShutdown.add(function() | 1937 onShutdown.add(function() |
1931 { | 1938 { |
1932 for (let window in UI.applicationWindows) | 1939 for (let window in UI.applicationWindows) |
1933 if (UI.isBottombarOpen(window)) | 1940 if (UI.isBottombarOpen(window)) |
1934 UI.toggleBottombar(window); | 1941 UI.toggleBottombar(window); |
1935 }); | 1942 }); |
LEFT | RIGHT |