From ccac057cea9d0852c33a970d12856ea39cd75291 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 25 Mar 2014 14:04:29 +0100 Subject: [PATCH] editor: openSelect view - expose setInput on the view object --- src/editor/views/openSelect/openSelect.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/editor/views/openSelect/openSelect.js b/src/editor/views/openSelect/openSelect.js index cc94854..718a4a0 100644 --- a/src/editor/views/openSelect/openSelect.js +++ b/src/editor/views/openSelect/openSelect.js @@ -36,11 +36,14 @@ var OpenSelect = Backbone.View.extend({ this.menu.empty(); this.toggleHandler(false); }, - onSelection: function(e) { - var val = $(e.target).text(); + setInput: function(value) { if(this.options.setInput) { - this.options.setInput(this.input, val); + this.options.setInput(this.input, value); } + }, + onSelection: function(e) { + var val = $(e.target).text(); + this.setInput(val); this.trigger('itemSelected', this.input.val()); } }); -- 2.20.1