From 51686e79d12387985334e5536d1beebbaeed057e Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 5 Jan 2014 23:23:44 +0000 Subject: [PATCH] Menubox - allow title change after rendered --- client/src/views/menubox.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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); -- 2.25.1