From: Aleksander Ɓukasz Date: Tue, 25 Mar 2014 13:04:29 +0000 (+0100) Subject: editor: openSelect view - expose setInput on the view object X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/ccac057cea9d0852c33a970d12856ea39cd75291?ds=sidebyside editor: openSelect view - expose setInput on the view object --- 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()); } });