PartPicker: enter hooks überlagerbar gemacht
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 2 Feb 2017 09:48:29 +0000 (10:48 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Mon, 13 Feb 2017 15:32:43 +0000 (16:32 +0100)
js/kivi.Part.js

index 06f9591..898024d 100644 (file)
@@ -289,6 +289,11 @@ namespace('kivi.Part', function(ns) {
       limit: 20,
       delay: 50,
       fat_set_item: $real.hasClass(CLASSES.FAT_SET_ITEM),
+      action: {
+        on_enter_match_none:  function(){},
+        on_enter_match_one:   function(){$('#update_button').click();},
+        on_enter_match_many:  function(){open_dialog();}
+      }
     }, options);
     var STATES = {
       PICKED:    CLASSES.PICKED,
@@ -487,8 +492,8 @@ namespace('kivi.Part', function(ns) {
         }
         if (event.which == KEY.ENTER) {
           handle_changed_text({
-            match_one:  function(){$('#update_button').click();},
-            match_many: function(){open_dialog();}
+            match_one:  o.action.on_enter_match_one,
+            match_many: o.action.on_enter_match_many
           });
           return false;
         }