Commit 4bbb68b5 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

ui: Trigger window resize when needed

parent 6694e800
......@@ -281,8 +281,10 @@
if (hide) {
this.firewall.stop().hide();
} else {
if (!cb) { cb = function() {}}
this.firewall.slideToggle(cb);
this.firewall.slideToggle(function() {
cb && cb();
$(window).trigger("resize");
});
}
this.firewall_toggler.toggleClass("open");
this.firewall_visible = this.firewall_toggler.hasClass("open");
......@@ -403,11 +405,14 @@
},
toggle_ports: function(e, hide) {
$(window).trigger("resize");
hide = hide === undefined ? false : hide;
if (hide) {
this.ports.stop().hide();
} else {
this.ports.stop().slideToggle();
this.ports.stop().slideToggle(function() {
$(window).trigger("resize");
});
}
this.ports_toggler.find(".cont-toggler").toggleClass("open");
this.ports_visible = this.ports_toggler.find(".cont-toggler").hasClass("open");
......
......@@ -285,11 +285,15 @@
toggle_content: function() {
if (!this.content_visible) {
this.content.slideDown();
this.content.slideDown(function() {
$(window).trigger("resize");
});
this.content_visible = true;
this.content_toggler.addClass("open");
} else {
this.content.slideUp();
this.content.slideUp(function() {
$(window).trigger("resize");
});
this.content_visible = false;
this.content_toggler.removeClass("open");
}
......
......@@ -290,6 +290,7 @@
handle_model_add: function(model, collection, options) {
this.add_model(model);
$(window).trigger("resize");
},
handle_model_remove: function(model, collection, options) {
......@@ -404,6 +405,7 @@
model_view.el.remove();
this.remove_view(model_view);
this.post_remove_model_view(model_view, m);
$(window).trigger("resize");
delete this._model_views[m.id];
this.check_empty();
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment