Created
November 25, 2012 05:43
-
-
Save rajaraodv/4142528 to your computer and use it in GitHub Desktop.
foobar directive with solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Wrap masonry with ImagesLoaded and wrap that again with a $timeout w/ a small delay solves the issue. | |
clientAppModule.directive('addMasonry', function($timeout) { | |
return { | |
restrict: 'A', | |
link: function(scope, element) { | |
$timeout(function(val) { //looks like timeout or deferred solves the issue | |
scope.container.imagesLoaded(function() { | |
scope.container.masonry('reload'); | |
}); | |
}, 0); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment