You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In trying to add gutter into the options for the masonry today, I noticed that when setting "gutter" the whole module broke. This appears to be because of the way Masonry looks at strings rather than Ints, in your code you get the options via .fromJson which always returns a string.
I have put in a quick fix to my code, may be a better way but it works for me. If this is helpful to you then please run with it, great module btw.
//line 7...
var container = elem[0];
var options = angular.extend({
itemSelector: '.item'
}, angular.fromJson(attrs.masonry));
// NEW - check for int value options
angular.forEach(options, function(x, y){
if (!isNaN(x)) options[y] = parseInt(x);
});
var masonry = scope.masonry = new Masonry(container, options);
//line 19...
The text was updated successfully, but these errors were encountered:
In trying to add gutter into the options for the masonry today, I noticed that when setting "gutter" the whole module broke. This appears to be because of the way Masonry looks at strings rather than Ints, in your code you get the options via .fromJson which always returns a string.
I have put in a quick fix to my code, may be a better way but it works for me. If this is helpful to you then please run with it, great module btw.
The text was updated successfully, but these errors were encountered: