diff --git a/bower.json b/bower.json index 48e2b9b..c6c7313 100644 --- a/bower.json +++ b/bower.json @@ -6,7 +6,7 @@ ], "description": "AngularJS module for bricklayer, a lightweight & independent cascading grid layout library", "main": "dist/angular-bricklayer.js", - "version": "1.0.1", + "version": "1.0.2", "moduleType": [], "keywords": [ "angular", diff --git a/dist/angular-bricklayer.js b/dist/angular-bricklayer.js index 3680e31..df0be96 100644 --- a/dist/angular-bricklayer.js +++ b/dist/angular-bricklayer.js @@ -1,6 +1,6 @@ /** @name: angular-bricklayer - @version: 1.0.1 (24-04-2016) + @version: 1.0.2 (24-04-2016) @author: @url: https://github.com/JohnnyTheTank/angular-bricklayer @license: MIT @@ -13,30 +13,21 @@ angular.module('jtt_bricklayer', []) var bricklayer = new Bricklayer(element[0]); $timeout(function () { - bricklayer.reorderElements(bricklayer.columnCount); + bricklayer.redraw(); }); scope.$on('bricklayer.append', function (event, element) { bricklayer.append(element); - bricklayer.reorderElements(bricklayer.columnCount); - $timeout(function () { - bricklayer.reorderElements(bricklayer.columnCount); - }); + bricklayer.redraw(); }); scope.$on('bricklayer.prepend', function (event, element) { bricklayer.prepend(element); - bricklayer.reorderElements(bricklayer.columnCount); - $timeout(function () { - bricklayer.reorderElements(bricklayer.columnCount); - }); + bricklayer.redraw(); }); - scope.$on('bricklayer.reorderElements', function () { - bricklayer.reorderElements(bricklayer.columnCount); - $timeout(function () { - bricklayer.reorderElements(bricklayer.columnCount); - }); + scope.$on('bricklayer.redraw', function () { + bricklayer.redraw(); }); } } diff --git a/dist/angular-bricklayer.min.js b/dist/angular-bricklayer.min.js index 6480f57..c692e96 100644 --- a/dist/angular-bricklayer.min.js +++ b/dist/angular-bricklayer.min.js @@ -1,8 +1,8 @@ /** @name: angular-bricklayer - @version: 1.0.1 (24-04-2016) + @version: 1.0.2 (24-04-2016) @author: @url: https://github.com/JohnnyTheTank/angular-bricklayer @license: MIT */ -angular.module("jtt_bricklayer",[]).directive("bricklayer",["$timeout",function(a){return{restrict:"C",link:function(b,c,d){var e=new Bricklayer(c[0]);a(function(){e.reorderElements(e.columnCount)}),b.$on("bricklayer.append",function(b,c){e.append(c),e.reorderElements(e.columnCount),a(function(){e.reorderElements(e.columnCount)})}),b.$on("bricklayer.prepend",function(b,c){e.prepend(c),e.reorderElements(e.columnCount),a(function(){e.reorderElements(e.columnCount)})}),b.$on("bricklayer.reorderElements",function(){e.reorderElements(e.columnCount),a(function(){e.reorderElements(e.columnCount)})})}}}]).directive("bricklayerAppend",function(){return{require:"?bricklayer",restrict:"ACE",link:function(a,b,c){a.$emit("bricklayer.append",b[0])}}}).directive("bricklayerPrepend",function(){return{require:"?bricklayer",restrict:"ACE",link:function(a,b,c){a.$emit("bricklayer.prepend",b[0])}}}); \ No newline at end of file +angular.module("jtt_bricklayer",[]).directive("bricklayer",["$timeout",function(a){return{restrict:"C",link:function(b,c,d){var e=new Bricklayer(c[0]);a(function(){e.redraw()}),b.$on("bricklayer.append",function(a,b){e.append(b),e.redraw()}),b.$on("bricklayer.prepend",function(a,b){e.prepend(b),e.redraw()}),b.$on("bricklayer.redraw",function(){e.redraw()})}}}]).directive("bricklayerAppend",function(){return{require:"?bricklayer",restrict:"ACE",link:function(a,b,c){a.$emit("bricklayer.append",b[0])}}}).directive("bricklayerPrepend",function(){return{require:"?bricklayer",restrict:"ACE",link:function(a,b,c){a.$emit("bricklayer.prepend",b[0])}}}); \ No newline at end of file diff --git a/package.json b/package.json index a3ceb00..178ac83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-bricklayer", - "version": "1.0.1", + "version": "1.0.2", "authors": [ "Jonathan Hornung " ],