From: Darren Date: Sun, 5 Jan 2014 23:23:44 +0000 (+0000) Subject: Menubox - allow title change after rendered X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=51686e79d12387985334e5536d1beebbaeed057e;p=KiwiIRC.git Menubox - allow title change after rendered --- diff --git a/client/src/views/menubox.js b/client/src/views/menubox.js index 71931c3..4249bb3 100644 --- a/client/src/views/menubox.js +++ b/client/src/views/menubox.js @@ -20,10 +20,10 @@ _kiwi.view.MenuBox = Backbone.View.extend({ this.$el.find('*').remove(); + $('
').appendTo(this.$el); if (this._title) { - $('
') - .text(this._title) - .appendTo(this.$el); + this.$el.find('.ui_menu_title') + .text(this._title); } @@ -39,6 +39,16 @@ _kiwi.view.MenuBox = Backbone.View.extend({ }, + setTitle: function(new_title) { + this._title = new_title; + + if (!this._title) + return; + + this.$el.find('.ui_menu_title').text(this._title); + }, + + onDocumentClick: function(event) { var $target = $(event.target);