eagerly call isotope before images are loaded; optimistically assume wallpaper is in the cache until we actually fix the issue [ci skip]

This commit is contained in:
danielgrippi 2012-05-09 00:36:14 -07:00
parent 62829aee85
commit b641cddb65
2 changed files with 15 additions and 4 deletions

View file

@ -27,7 +27,9 @@ app.pages.Profile = app.views.Base.extend({
this.model = this.model || app.models.Profile.preloadOrFetch(this.personGUID) this.model = this.model || app.models.Profile.preloadOrFetch(this.personGUID)
this.stream = options && options.stream || new app.models.Stream() this.stream = options && options.stream || new app.models.Stream()
this.model.bind("change", this.setPageTitleAndBackground, this) /* this needs to be fixed... used to be bound by this.model change event.
* will most likely result in spontaneous results :( */
this.setPageTitleAndBackground()
/* binds for getting started pulsation */ /* binds for getting started pulsation */
this.stream.bind("fetched", this.pulsateNewPostControl, this) this.stream.bind("fetched", this.pulsateNewPostControl, this)

View file

@ -38,8 +38,17 @@ app.views.Canvas = app.views.Base.extend(_.extend({}, app.views.infiniteScrollMi
mason : function() { mason : function() {
var el = this.$el; var el = this.$el;
el.imagesLoaded(function(){
el.isotope({ /* make two calls to isotope
1) on dom ready
2) on images ready
*/
triggerIsotope(el) && el.imagesLoaded(function(){
triggerIsotope(el)
})
function triggerIsotope(element) {
return element.isotope({
itemSelector : '.canvas-frame', itemSelector : '.canvas-frame',
visibleStyle : {scale : 1}, visibleStyle : {scale : 1},
hiddenStyle : {scale : 0.001}, hiddenStyle : {scale : 0.001},
@ -48,7 +57,7 @@ app.views.Canvas = app.views.Base.extend(_.extend({}, app.views.infiniteScrollMi
columnWidth : 292.5 columnWidth : 292.5
} }
}) })
}) }
}, },
triggerRelayoutAfterImagesLoaded : function(){ triggerRelayoutAfterImagesLoaded : function(){