OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 if (node) | 62 if (node) |
63 { | 63 { |
64 E("tabs").selectedIndex = tabIndex; | 64 E("tabs").selectedIndex = tabIndex; |
65 Utils.runAsync(function() | 65 Utils.runAsync(function() |
66 { | 66 { |
67 node.parentNode.ensureElementIsVisible(node); | 67 node.parentNode.ensureElementIsVisible(node); |
68 node.parentNode.selectItem(node); | 68 node.parentNode.selectItem(node); |
69 if (!FilterActions.visible) | 69 if (!FilterActions.visible) |
70 E("subscription-showHideFilters-command").doCommand(); | 70 E("subscription-showHideFilters-command").doCommand(); |
71 Utils.runAsync(FilterView.selectFilter, FilterView, filter); | 71 Utils.runAsync(() => FilterView.selectFilter(filter)); |
72 }); | 72 }); |
73 } | 73 } |
74 }, | 74 }, |
75 | 75 |
76 /** | 76 /** |
77 * Updates subscription commands whenever the selected subscription changes. | 77 * Updates subscription commands whenever the selected subscription changes. |
78 * Note: this method might be called with a wrong "this" value. | 78 * Note: this method might be called with a wrong "this" value. |
79 */ | 79 */ |
80 updateCommands: function() | 80 updateCommands: function() |
81 { | 81 { |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 }); | 531 }); |
532 parent.appendChild(node); | 532 parent.appendChild(node); |
533 listedSubscriptions.push(subscription); | 533 listedSubscriptions.push(subscription); |
534 } | 534 } |
535 let selectedNode = Utils.chooseFilterSubscription(listedSubscriptions); | 535 let selectedNode = Utils.chooseFilterSubscription(listedSubscriptions); |
536 list.selectedItem = Templater.getNodeForData(parent, "node", selectedNode)
|| parent.firstChild; | 536 list.selectedItem = Templater.getNodeForData(parent, "node", selectedNode)
|| parent.firstChild; |
537 | 537 |
538 // Show panel and focus list | 538 // Show panel and focus list |
539 let position = (Utils.versionComparator.compare(Utils.platformVersion, "2.
0") < 0 ? "after_end" : "bottomcenter topleft"); | 539 let position = (Utils.versionComparator.compare(Utils.platformVersion, "2.
0") < 0 ? "after_end" : "bottomcenter topleft"); |
540 panel.openPopup(E("selectSubscriptionButton"), position, 0, 0, false, fals
e, event); | 540 panel.openPopup(E("selectSubscriptionButton"), position, 0, 0, false, fals
e, event); |
541 Utils.runAsync(list.focus, list); | 541 Utils.runAsync(() => list.focus()); |
542 }; | 542 }; |
543 request.send(); | 543 request.send(); |
544 }, | 544 }, |
545 | 545 |
546 /** | 546 /** |
547 * Adds filter subscription that is selected. | 547 * Adds filter subscription that is selected. |
548 */ | 548 */ |
549 add: function() | 549 add: function() |
550 { | 550 { |
551 E("selectSubscriptionPanel").hidePopup(); | 551 E("selectSubscriptionPanel").hidePopup(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 return; | 597 return; |
598 | 598 |
599 if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_EN
TER) | 599 if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_EN
TER) |
600 { | 600 { |
601 // This shouldn't accept our dialog, only the panel | 601 // This shouldn't accept our dialog, only the panel |
602 event.preventDefault(); | 602 event.preventDefault(); |
603 E("selectSubscriptionAccept").doCommand(); | 603 E("selectSubscriptionAccept").doCommand(); |
604 } | 604 } |
605 } | 605 } |
606 }; | 606 }; |
OLD | NEW |