From 1650ef68ef7570b10992f280975150e579dc7830 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 19 Jul 2016 13:08:21 +0800 Subject: [PATCH] remove unused --- src/sortable.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/sortable.js b/src/sortable.js index 19f3770..7c799d1 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -23,8 +23,8 @@ angular.module('ui.sortable', []) var savedNodes; function combineCallbacks(first, second){ - var firstIsFunc = first && (typeof first === 'function'); - var secondIsFunc = second && (typeof second === 'function'); + var firstIsFunc = typeof first === 'function'; + var secondIsFunc = typeof second === 'function'; if(firstIsFunc && secondIsFunc) { return function() { first.apply(this, arguments); @@ -62,12 +62,8 @@ angular.module('ui.sortable', []) } // patch the options that need to have values set - if (!value) { - if (key === 'items') { - value = uiSortableConfig.items; - } else if (key === 'ui-model-items') { - value = uiSortableConfig.items; - } + if (!value && (key === 'items' || key === 'ui-model-items')) { + value = uiSortableConfig.items; } return value;