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

Side by Side Diff: chrome/content/ui/filters-search.js

Issue 4884233277407232: Issue 2257 - Replaced non-standard function expressions with ES6 arrow functions (Closed)
Patch Set: Created April 1, 2015, 2:24 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
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 text = normalizeString(text); 84 text = normalizeString(text);
85 85
86 // First try to find the entry in the current list 86 // First try to find the entry in the current list
87 if (findText(text, direction, E("filtersTree").currentIndex)) 87 if (findText(text, direction, E("filtersTree").currentIndex))
88 return Ci.nsITypeAheadFind.FIND_FOUND; 88 return Ci.nsITypeAheadFind.FIND_FOUND;
89 89
90 // Now go through the other subscriptions 90 // Now go through the other subscriptions
91 let result = Ci.nsITypeAheadFind.FIND_FOUND; 91 let result = Ci.nsITypeAheadFind.FIND_FOUND;
92 let subscriptions = FilterStorage.subscriptions.slice(); 92 let subscriptions = FilterStorage.subscriptions.slice();
93 subscriptions.sort(function(s1, s2) (s1 instanceof SpecialSubscription) - (s 2 instanceof SpecialSubscription)); 93 subscriptions.sort((s1, s2) => (s1 instanceof SpecialSubscription) - (s2 ins tanceof SpecialSubscription));
94 let current = subscriptions.indexOf(FilterView.subscription); 94 let current = subscriptions.indexOf(FilterView.subscription);
95 direction = direction || 1; 95 direction = direction || 1;
96 for (let i = current + direction; ; i+= direction) 96 for (let i = current + direction; ; i+= direction)
97 { 97 {
98 if (i < 0) 98 if (i < 0)
99 { 99 {
100 i = subscriptions.length - 1; 100 i = subscriptions.length - 1;
101 result = Ci.nsITypeAheadFind.FIND_WRAPPED; 101 result = Ci.nsITypeAheadFind.FIND_WRAPPED;
102 } 102 }
103 else if (i >= subscriptions.length) 103 else if (i >= subscriptions.length)
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 { 230 {
231 E("filtersTree").boxObject.scrollByPages(num); 231 E("filtersTree").boxObject.scrollByPages(num);
232 }, 232 },
233 } 233 }
234 }; 234 };
235 235
236 window.addEventListener("load", function() 236 window.addEventListener("load", function()
237 { 237 {
238 FilterSearch.init(); 238 FilterSearch.init();
239 }, false); 239 }, false);
OLDNEW
« no previous file with comments | « chrome/content/ui/filters-filterview.js ('k') | chrome/content/ui/filters-subscriptionactions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld