From 716cfcb95f70acc15e1d5d8a62cb7a60e03871cd Mon Sep 17 00:00:00 2001 From: Gerd Jungbluth Date: Sat, 20 Apr 2013 17:15:58 +0200 Subject: [PATCH 1/2] added var statement for 'onStop', reordered vars changed comment from _start to _stop --- src/sortable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sortable.js b/src/sortable.js index ee31e9f..267707a 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -8,7 +8,7 @@ angular.module('ui.sortable', []).value('uiSortableConfig',{}).directive('uiSort return { require: '?ngModel', link: function(scope, element, attrs, ngModel) { - var onReceive, onRemove, onStart, onUpdate, opts; + var onStart, onUpdate, onReceive, onRemove, onStop, opts; opts = angular.extend({}, uiSortableConfig, scope.$eval(attrs.uiSortable)); @@ -70,7 +70,7 @@ angular.module('ui.sortable', []).value('uiSortableConfig',{}).directive('uiSort } })(opts.start); - // If user provided 'start' callback compose it with onStart function + // If user provided 'stop' callback compose it with onStop function opts.stop = (function(_stop){ return function(e, ui) { onStop(e, ui); From 3e45085a8d0e8c5df96f4cb9092f19003737769f Mon Sep 17 00:00:00 2001 From: Gerd Jungbluth Date: Sat, 20 Apr 2013 17:21:08 +0200 Subject: [PATCH 2/2] added {} and ; to make JSHint pass --- src/sortable.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/sortable.js b/src/sortable.js index 267707a..7b7a9c7 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -65,44 +65,49 @@ angular.module('ui.sortable', []).value('uiSortableConfig',{}).directive('uiSort opts.start = (function(_start){ return function(e, ui) { onStart(e, ui); - if (typeof _start === "function") + if ( typeof _start === "function") { _start(e, ui); - } + } + }; })(opts.start); // If user provided 'stop' callback compose it with onStop function opts.stop = (function(_stop){ return function(e, ui) { onStop(e, ui); - if (typeof _stop === "function") + if (typeof _stop === "function") { _stop(e, ui); - } + } + }; })(opts.stop); // If user provided 'update' callback compose it with onUpdate function opts.update = (function(_update){ return function(e, ui) { onUpdate(e, ui); - if (typeof _update === "function") + if (typeof _update === "function") { _update(e, ui); - } + } + }; })(opts.update); // If user provided 'receive' callback compose it with onReceive function opts.receive = (function(_receive){ return function(e, ui) { onReceive(e, ui); - if (typeof _receive === "function") + if (typeof _receive === "function") { _receive(e, ui); - } + } + }; })(opts.receive); // If user provided 'remove' callback compose it with onRemove function opts.remove = (function(_remove){ return function(e, ui) { onRemove(e, ui); - if (typeof _remove === "function") + if (typeof _remove === "function") { _remove(e, ui); + } }; })(opts.remove); }