From 099a07644058db6dc0adfc72ed275bedb4b6970a Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 10 Apr 2014 17:43:52 +0000 Subject: [PATCH] Toggleable ban list --- client/src/index.html.tmpl | 4 ++-- client/src/views/channelinfo.js | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/client/src/index.html.tmpl b/client/src/index.html.tmpl index 7a5bdcf..e873bdb 100644 --- a/client/src/index.html.tmpl +++ b/client/src/index.html.tmpl @@ -95,11 +95,11 @@
- + - + diff --git a/client/src/views/channelinfo.js b/client/src/views/channelinfo.js index d26e2b5..b5caed4 100644 --- a/client/src/views/channelinfo.js +++ b/client/src/views/channelinfo.js @@ -2,7 +2,7 @@ _kiwi.view.ChannelInfo = Backbone.View.extend({ events: { - 'click .show_banlist': 'updateBanlist', + 'click .toggle_banlist': 'toggleBanList', 'change .channel-mode': 'onModeChange', 'click .remove-ban': 'onRemoveBanClick' }, @@ -120,6 +120,7 @@ _kiwi.view.ChannelInfo = Backbone.View.extend({ banlist = channel.get('banlist'); if (banlist && banlist.length) { + this.$el.find('.channel-banlist table').show(); var $table = this.$el.find('.channel-banlist table tbody'); this.$el.find('.banlist-status').text(''); @@ -137,27 +138,24 @@ _kiwi.view.ChannelInfo = Backbone.View.extend({ }); this.$el.find('.channel-banlist table').slideDown(); - } else { this.$el.find('.banlist-status').text('Banlist empty'); this.$el.find('.channel-banlist table').hide(); } }, - - updateBanlist: function (event) { + toggleBanList: function (event) { event.preventDefault(); - + this.$el.find('.channel-banlist table').toggle(); var channel = this.model.get('channel'), - network = channel.get('network'); + network = channel.get('network'); network.gateway.raw('MODE ' + channel.get('name') + ' +b'); }, - dispose: function () { this.model.get('channel').off('change:info_modes change:info_url change:banlist', this.updateInfo, this); this.$el.remove(); } -}); \ No newline at end of file +}); -- 2.25.1
Bank MaskBan Mask Added By Date Added