diff options
Diffstat (limited to 'module/web/static/js/views/fileView.js')
-rw-r--r-- | module/web/static/js/views/fileView.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/module/web/static/js/views/fileView.js b/module/web/static/js/views/fileView.js index f4f228559..32ce7d723 100644 --- a/module/web/static/js/views/fileView.js +++ b/module/web/static/js/views/fileView.js @@ -14,6 +14,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'], initialize: function() { this.listenTo(this.model, 'change', this.render); + // This will be triggered manually and changed before with silent=true this.listenTo(this.model, 'change:visible', this.visibility_changed); this.listenTo(this.model, 'remove', this.destroy); }, @@ -63,8 +64,14 @@ define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'], App.vent.trigger('file:selection'); }, - visibility_changed: function() { - + visibility_changed: function(visible) { + // TODO: improve animation + if (visible) + this.$el.slideOut(); + else { + this.$el.calculateHeight(true); + this.$el.slideIn(); + } } }); |