Skip to content

Commit

Permalink
Bug 1413156 - Convert from lodash bind to native ES6 (#3536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Titan-C authored and edmorley committed May 10, 2018
1 parent be3c6e8 commit dc2a2e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/js/services/pinboard.js
Expand Up @@ -130,7 +130,7 @@ treeherder.factory('thPinboard', [
}
}

_.each(pinnedJobs, _.bind(saveClassification, classification));
_.each(pinnedJobs, saveClassification.bind(classification));
$rootScope.$emit(thEvents.jobsClassified, { jobs: pinnedJobsClone });

_.each(pinnedJobs, saveBugs);
Expand All @@ -141,7 +141,7 @@ treeherder.factory('thPinboard', [

// save the classification only on all pinned jobs
saveClassificationOnly: function (classification) {
_.each(pinnedJobs, _.bind(saveClassification, classification));
_.each(pinnedJobs, saveClassification.bind(classification));
$rootScope.$emit(thEvents.jobsClassified, { jobs: pinnedJobs });
},

Expand Down
3 changes: 1 addition & 2 deletions ui/plugins/pinboard.js
@@ -1,5 +1,4 @@
import $ from 'jquery';
import _ from 'lodash';
import Mousetrap from 'mousetrap';

import treeherder from '../js/treeherder';
Expand Down Expand Up @@ -255,7 +254,7 @@ treeherder.controller('PinboardCtrl', [
// Rebind escape to canceling the bug entry, pressing escape
// again will close the pinboard as usual.
Mousetrap.bind('escape', function () {
const cancel = _.bind($scope.toggleEnterBugNumber, $scope, false);
const cancel = $scope.toggleEnterBugNumber.bind($scope, false);
$scope.$evalAsync(cancel);
});

Expand Down

0 comments on commit dc2a2e2

Please sign in to comment.