Created
January 5, 2012 21:54
-
-
Save nambrot/1567536 to your computer and use it in GitHub Desktop.
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
addModel: function (model, scroll) { | |
if (model != null) | |
{ | |
// we want to set a new model, check whether we already have one or not | |
if (this.model == null) | |
{ | |
// split the views | |
a.setRatio(0.5); | |
// set the maximiztion and close tools | |
this.tools = $('<div class="tools"><div id="close"><img src="/close.png" alt="" /></div><div id="max"><img src="/max.png" alt="" /></div></div>'); | |
$(this.el).append(this.tools); | |
} | |
else | |
{ | |
// we do have a model set, so just remove it | |
$(this.view.el).remove() | |
} | |
// add the model to the view | |
this.model = model; | |
this.view = new a.modelmap[model.type].fullView({model: model}); | |
$(this.el).append(this.view.el); | |
$(this.view.el).addClass('fastanimated bounceIn'); | |
// if we are in full screen, add it to there too | |
if (a.fullscreenviewer) | |
a.fullscreenviewer.addModel(model); | |
} | |
else | |
{ | |
// we want to reset it in case we have something in the viewer | |
if (this.model != null) | |
this.close(); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment