Bug 1207491 - Part 2: Remove use of expression closure from browser/components/customizableui/PanelWideWidgetTracker.jsm. r=Gijs

This commit is contained in:
Tooru Fujisawa 2015-09-23 18:36:20 +09:00
parent 2a8329db8e
commit 3e2b62cfbd

View File

@ -97,9 +97,9 @@ var PanelWideWidgetTracker = {
// we want to start with the last widgets. Otherwise we move widgets over other wide
// widgets, which might mess up their order. Likewise, if moving backwards we should start with
// the first widget and work our way down/right from there.
let compareFn = aMoveForwards ? (function(a, b) a < b) : (function(a, b) a > b)
widgetsAffected.sort(function(a, b) compareFn(gPanelPlacements.indexOf(a),
gPanelPlacements.indexOf(b)));
let compareFn = aMoveForwards ? ((a, b) => a < b) : ((a, b) => a > b);
widgetsAffected.sort((a, b) => compareFn(gPanelPlacements.indexOf(a),
gPanelPlacements.indexOf(b)));
for (let widget of widgetsAffected) {
this.adjustPosition(widget, aMoveForwards);
}