__dirname + '/src/views/userbox.js',\r
__dirname + '/src/views/channeltools.js',\r
__dirname + '/src/views/channelinfo.js',\r
+ __dirname + 'src/views/rightbar.js',\r
\r
__dirname + '/src/applets/settings.js',\r
__dirname + '/src/applets/chanlist.js',\r
*/\r
this.controlbox = new _kiwi.view.ControlBox({el: $('#kiwi .controlbox')[0]});\r
this.bindControllboxCommands(this.controlbox);\r
+ this.rightbar = new _kiwi.view.RightBar({el: this.view.$('.right_bar')[0]});\r
\r
this.topicbar = new _kiwi.view.TopicBar({el: this.view.$el.find('.topic')[0]});\r
\r
}
// Set the panels width depending on the memberlist visibility
- if (el_right_bar.css('display') != 'none') {
+ if (!el_right_bar.hasClass('disabled')) {
// Panels to the side of the memberlist
el_panels.css('right', el_right_bar.outerWidth(true));
// The resize handle sits overlapping the panels and memberlist
clickHideRightBar: function (event) {
event.preventDefault();
- _kiwi.app.view.$('.right_bar').toggleClass('disabled');
+ _kiwi.app.rightbar.toggle();
_kiwi.app.view.doLayout();
}
});
// Show this panels memberlist
var members = this.model.get("members");
if (members) {
- $('#kiwi .right_bar').removeClass('disabled');
+ _kiwi.app.rightbar.show();
members.view.show();
} else {
- // Memberlist not found for this panel, hide any active ones
- $('#kiwi .right_bar').addClass('disabled').children().removeClass('active');
+ _kiwi.app.rightbar.hide();
}
// Remove any alerts and activity counters for this panel
--- /dev/null
+_kiwi.view.RightBar = Backbone.View.extend({
+ initialize: function() {
+ this.keep_hidden = false;
+ this.hidden = false;
+ },
+
+
+ hide: function() {
+ this.hidden = true;
+ this.$el.addClass('disabled');
+ },
+
+
+ show: function() {
+ this.hidden = false;
+
+ if (!this.keep_hidden)
+ this.$el.removeClass('disabled');
+ },
+
+
+ // Toggle if the rightbar should be shown or not
+ toggle: function() {
+ this.keep_hidden = !this.keep_hidden;
+
+ if (this.keep_hidden || this.hidden) {
+ this.$el.addClass('disabled');
+ } else {
+ this.$el.removeClass('disabled');
+ }
+ }
+});
\ No newline at end of file
'src/views/topicbar.js',
'src/views/userbox.js',
'src/views/channeltools.js',
- 'src/views/channelinfo.js'
+ 'src/views/channelinfo.js',
+ 'src/views/rightbar.js'
],
[
'src/applets/settings.js',