some refactoring of viewer.js...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-10-28 13:22:54 +03:00
parent 2f2a6a0045
commit f2b7d68672

View File

@ -468,31 +468,21 @@ actions.Actions(Client, {
this.ribbons = ribbons.Ribbons(viewer, data.images) this.ribbons = ribbons.Ribbons(viewer, data.images)
} }
// NOTE: this is here to prevent animations when the view
// is resized and recentered...
this.ribbons.preventTransitions()
// XXX should we use this.reload() here???
return function(){ return function(){
// XXX do a partial load... // XXX do a partial load...
// XXX // XXX
this.ribbons.updateData(this.data) this.reload()
this.focusImage()
this.ribbons.restoreTransitions()
} }
}], }],
reload: [ reload: ['Reload viewer',
function(){ function(){
this.ribbons.preventTransitions() this.ribbons.preventTransitions()
return function(){ this.ribbons.updateData(this.data)
this.ribbons.updateData(this.data) this.focusImage()
this.focusImage()
this.ribbons.restoreTransitions() this.ribbons.restoreTransitions()
}
}], }],
clear: [ clear: [
// XXX do we need to delete the ribbons??? // XXX do we need to delete the ribbons???