From d4848ffeb216dc4dc512b2566cc435b389a71d9c Mon Sep 17 00:00:00 2001 From: billyct Date: Wed, 9 Apr 2014 17:34:22 +0800 Subject: [PATCH] samll change when i use the ui-route and come out with the "Error: cannot call methods on sortable prior to initialization; attempted to call method 'option'".so give a small change when the sortable page is not removed then dont do sortable('option') --- src/sortable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sortable.js b/src/sortable.js index 786a776..4a91c1b 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -184,7 +184,8 @@ angular.module('ui.sortable', []) // wrap the callback value = combineCallbacks(callbacks[key], value); } - element.sortable('option', key, value); + if(element.is(':visible')) + element.sortable('option', key, value); }); }, true);