From 9e5115ca6dcf7453845f16f71380a50b84c30dbc Mon Sep 17 00:00:00 2001 From: Won Song Date: Fri, 1 Aug 2014 18:09:05 -0400 Subject: [PATCH 1/3] Fixes .find() is undefined issue when sorting is enabled --- src/angular-isotope/controllers/controllers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/angular-isotope/controllers/controllers.js b/src/angular-isotope/controllers/controllers.js index be319e3..3d1525b 100644 --- a/src/angular-isotope/controllers/controllers.js +++ b/src/angular-isotope/controllers/controllers.js @@ -160,8 +160,9 @@ angular.module("iso.controllers", ["iso.config", "iso.services"]) }); return reduction; }; - getValue = function(selector, $elem, type, evaluate) { + getValue = function(selector, elem, type, evaluate) { var getText, item, text, toType, val; + var $elem = angular.element(elem); getText = function($elem, item, selector) { var text; if (!item.length) { From ee0df52f87f20feb9987fce69fe676e2539d57d9 Mon Sep 17 00:00:00 2001 From: Won Song Date: Sat, 2 Aug 2014 09:18:21 -0400 Subject: [PATCH 2/3] Making determineActiveClass explicit --- src/angular-isotope/directives/directives.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angular-isotope/directives/directives.js b/src/angular-isotope/directives/directives.js index f45f6ad..019ca54 100644 --- a/src/angular-isotope/directives/directives.js +++ b/src/angular-isotope/directives/directives.js @@ -95,7 +95,7 @@ angular.module("iso.directives") methPublish = attrs.okMethodPublish || topics.MSG_METHOD; optKey = optionSet.attr("ok-key"); - determineActiveClass = function() { + var determineActiveClass = function() { activeClass = attrs.okActiveClass; if (!activeClass) { activeClass = optionSet.find(".selected").length ? "selected" : "active"; From 5b9f1ae74dfe4a52a7f7c5d37f6a9db811e20d7c Mon Sep 17 00:00:00 2001 From: Won Song Date: Sat, 2 Aug 2014 10:49:14 -0400 Subject: [PATCH 3/3] Reverting the previous change, and fixing typ'o related to determineActiveClass --- src/angular-isotope/directives/directives.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/angular-isotope/directives/directives.js b/src/angular-isotope/directives/directives.js index 019ca54..a8095e2 100644 --- a/src/angular-isotope/directives/directives.js +++ b/src/angular-isotope/directives/directives.js @@ -89,13 +89,13 @@ angular.module("iso.directives") restrict: "A", controller: "isoSortByDataController", link: function(scope, element, attrs) { - var createSortByDataMethods, createOptions, doOption, emitOption, optKey, optPublish, methPublish, optionSet, determineAciveClass, activeClass, activeSelector, active; + var createSortByDataMethods, createOptions, doOption, emitOption, optKey, optPublish, methPublish, optionSet, determineActiveClass, activeClass, activeSelector, active; optionSet = $(element); optPublish = attrs.okPublish || attrs.okOptionsPublish || topics.MSG_OPTIONS; methPublish = attrs.okMethodPublish || topics.MSG_METHOD; optKey = optionSet.attr("ok-key"); - var determineActiveClass = function() { + determineActiveClass = function() { activeClass = attrs.okActiveClass; if (!activeClass) { activeClass = optionSet.find(".selected").length ? "selected" : "active";