opt.timeout = opt.timeout || 5000;\r
\r
this.$el.text(text).attr('class', opt.type);\r
- this.$el.slideDown(_kiwi.app.view.doLayout);\r
+ this.$el.slideDown($.proxy(_kiwi.app.view.doLayout, this));\r
\r
if (opt.timeout) this.doTimeout(opt.timeout);\r
},\r
},\r
\r
hide: function () {\r
- this.$el.slideUp(_kiwi.app.view.doLayout);\r
+ this.$el.slideUp($.proxy(_kiwi.app.view.doLayout, this));\r
},\r
\r
doTimeout: function (length) {\r
\r
_kiwi.view.Application = Backbone.View.extend({\r
initialize: function () {\r
- $(window).resize(this.doLayout);\r
- $('#toolbar').resize(this.doLayout);\r
- $('#controlbox').resize(this.doLayout);\r
+ var that = this;\r
+\r
+ $(window).resize(function() { that.doLayout.apply(that); });\r
+ $('#toolbar').resize(function() { that.doLayout.apply(that); });\r
+ $('#controlbox').resize(function() { that.doLayout.apply(that); });\r
\r
// Change the theme when the config is changed\r
_kiwi.global.settings.on('change:theme', this.updateTheme, this);\r
\r
\r
doLayout: function () {\r
- var el_kiwi = $('#kiwi');\r
- var el_panels = $('#panels');\r
- var el_memberlists = $('#memberlists');\r
- var el_toolbar = $('#toolbar');\r
- var el_controlbox = $('#controlbox');\r
- var el_resize_handle = $('#memberlists_resize_handle');\r
+ var el_kiwi = this.$el; //$('#kiwi');\r
+ var el_panels = $('#panels', el_kiwi);\r
+ var el_memberlists = $('#memberlists', el_kiwi);\r
+ var el_toolbar = $('#toolbar', el_kiwi);\r
+ var el_controlbox = $('#controlbox', el_kiwi);\r
+ var el_resize_handle = $('#memberlists_resize_handle', el_kiwi);\r
\r
var css_heights = {\r
top: el_toolbar.outerHeight(true),\r
\r
// If we have channel tabs on the side, adjust the height\r
if (el_kiwi.hasClass('chanlist_treeview')) {\r
- $('#kiwi #tabs').css(css_heights);\r
+ $('#tabs', el_kiwi).css(css_heights);\r
}\r
\r
// Determine if we have a narrow window (mobile/tablet/or even small desktop window)\r
var that = this;\r
\r
if (!instant) {\r
- $('#toolbar').slideUp({queue: false, duration: 400, step: this.doLayout});\r
- $('#controlbox').slideUp({queue: false, duration: 400, step: this.doLayout});\r
+ $('#toolbar').slideUp({queue: false, duration: 400, step: $.proxy(this.doLayout, this)});\r
+ $('#controlbox').slideUp({queue: false, duration: 400, step: $.proxy(this.doLayout, this)});\r
} else {\r
$('#toolbar').slideUp(0);\r
$('#controlbox').slideUp(0);\r
var that = this;\r
\r
if (!instant) {\r
- $('#toolbar').slideDown({queue: false, duration: 400, step: this.doLayout});\r
- $('#controlbox').slideDown({queue: false, duration: 400, step: this.doLayout});\r
+ $('#toolbar').slideDown({queue: false, duration: 400, step: $.proxy(this.doLayout, this)});\r
+ $('#controlbox').slideDown({queue: false, duration: 400, step: $.proxy(this.doLayout, this)});\r
} else {\r
$('#toolbar').slideDown(0);\r
$('#controlbox').slideDown(0);\r