diff --git a/angular-flexslider.coffee b/angular-flexslider.coffee index a943143..1bf9af9 100644 --- a/angular-flexslider.coffee +++ b/angular-flexslider.coffee @@ -61,9 +61,9 @@ angular.module('angular-flexslider', []) collection ?= [] trackCollection = {} for c in collection - trackCollection[c] = getTrackFromItem c + trackCollection[getTrackFromItem(c)] = c # Generates arrays of collection items to add and remvoe - toAdd = (c for c in collection when not slidesItems[trackCollection[c]]?) + toAdd = (c for c in collection when not slidesItems[getTrackFromItem(c)]?) toRemove = (i.collectionItem for t, i of slidesItems when not trackCollection[t]?) # Workaround to a still unresolved problem in using flexslider.addSlide if (toAdd.length == 1 and toRemove.length == 0) or toAdd.length == 0 diff --git a/angular-flexslider.js b/angular-flexslider.js index 50b6ff3..788d541 100644 --- a/angular-flexslider.js +++ b/angular-flexslider.js @@ -75,7 +75,7 @@ trackCollection = {}; for (_i = 0, _len = collection.length; _i < _len; _i++) { c = collection[_i]; - trackCollection[c] = getTrackFromItem(c); + trackCollection[getTrackFromItem(c)] = c; } toAdd = (function() { var _j, _len1, _results; @@ -83,7 +83,7 @@ _results = []; for (_j = 0, _len1 = collection.length; _j < _len1; _j++) { c = collection[_j]; - if (slidesItems[trackCollection[c]] == null) { + if (slidesItems[getTrackFromItem(c)] == null) { _results.push(c); } } diff --git a/bower.json b/bower.json index 782db69..fe14d36 100644 --- a/bower.json +++ b/bower.json @@ -1,18 +1,16 @@ { - "name": "angular-flexslider", - "version": "1.2.4", - "main": "./angular-flexslider.js", - "dependencies": { - "angular": "~1.2.4", - "jquery": "2.0.2", - "flexslider": "latest" - }, - "readme": "angular-flexslider\n======================\n\nbower repo for angular-flexslider.js", - "readmeFilename": "README.md", - "_id": "angular-flexslider@1.2.4", - "description": "bower-angular-flexslider ======================", - "repository": { - "type": "git", - "url": "git://github.com/EnthusiasticCode/angular-flexslider.git" - } + "name": "angular-flexslider", + "version": "1.2.6", + "main": "./angular-flexslider.js", + "dependencies": { + "angular": "~1.2.16", + "jquery": "2.0.2", + "flexslider": "latest" + }, + "readmeFilename": "README.md", + "description": "AngularJS wrapper for Flexslider", + "repository": { + "type": "git", + "url": "git://github.com/EnthusiasticCode/angular-flexslider.git" + } } \ No newline at end of file diff --git a/examples/add-remove-slides.html b/examples/add-remove-slides.html index 0939184..710df32 100644 --- a/examples/add-remove-slides.html +++ b/examples/add-remove-slides.html @@ -12,10 +12,10 @@