Skip to content

Instantly share code, notes, and snippets.

@nambrot
Created January 5, 2012 21:24
Show Gist options
  • Save nambrot/1567385 to your computer and use it in GitHub Desktop.
Save nambrot/1567385 to your computer and use it in GitHub Desktop.
addModel: function (model, scroll) {
// remove the old model
var old = $(this.contentview).children();
old.addClass('animated bounceOutLeft');
window.setTimeout(function () {
old.removeClass('animated bounceOutLeft');
old.remove();
}, 1000);
// attach the new model
this.model = model;
// create the view
this.subview = new model.view({model:model});
$(this.contentview).append(this.subview.el);
$(this.subview.el).addClass('animated bounceInLeft');
$(this.el).animate({scrollTop: scroll}, 1000);
this.subview.trigger('appended');
// close the fullscreen if its open
if (a.fullscreenviewer)
a.fullscreenviewer.close();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment