Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit ec6567f

Browse files
author
michaschwab
committed
memory efficiency with angular.noop
1 parent 6991b9f commit ec6567f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sortable.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ angular.module('ui.sortable', [])
448448
$log.info('ui.sortable: ngModel not provided!', element);
449449
}
450450

451-
var listener = function() {};
451+
var stopDisabledWatcher = angular.noop;
452452

453453
var startIfEnabled = function()
454454
{
@@ -458,7 +458,7 @@ angular.module('ui.sortable', [])
458458
element.sortable(opts);
459459

460460
// Stop Watcher
461-
listener();
461+
stopDisabledWatcher();
462462

463463
return true;
464464
}
@@ -467,7 +467,7 @@ angular.module('ui.sortable', [])
467467

468468
if(!startIfEnabled())
469469
{
470-
listener = scope.$watch('uiSortable.disabled', startIfEnabled);
470+
stopDisabledWatcher = scope.$watch('uiSortable.disabled', startIfEnabled);
471471
}
472472
}
473473
};

0 commit comments

Comments
 (0)