editor: openSelect view - allow for clearing items list
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 25 Mar 2014 13:04:15 +0000 (14:04 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 25 Mar 2014 13:04:15 +0000 (14:04 +0100)
src/editor/views/openSelect/openSelect.js

index eeea988..cc94854 100644 (file)
@@ -32,6 +32,10 @@ var OpenSelect = Backbone.View.extend({
         this.menu.append(_.template(itemTemplate)({value: value}));
         this.toggleHandler(true);
     },
         this.menu.append(_.template(itemTemplate)({value: value}));
         this.toggleHandler(true);
     },
+    clearItems: function() {
+        this.menu.empty();
+        this.toggleHandler(false);
+    },
     onSelection: function(e) {
         var val = $(e.target).text();
         if(this.options.setInput) {
     onSelection: function(e) {
         var val = $(e.target).text();
         if(this.options.setInput) {