From 4ca20c47cf1071ed92fb508b13151c013a4a1f39 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 1 Nov 2015 16:35:40 -0500 Subject: [PATCH] Make shortcut key values a setting #3016 --- src/definitions/modules/dropdown.js | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 791495686..738ad79d6 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -40,6 +40,7 @@ $.fn.dropdown = function(parameters) { className = settings.className, message = settings.message, fields = settings.fields, + keys = settings.keys, metadata = settings.metadata, namespace = settings.namespace, regExp = settings.regExp, @@ -1021,7 +1022,6 @@ $.fn.dropdown = function(parameters) { keydown: function(event) { var pressedKey = event.which, - keys = module.get.shortcutKeys(), isShortcutKey = module.is.inObject(pressedKey, keys) ; if(isShortcutKey) { @@ -1135,7 +1135,6 @@ $.fn.dropdown = function(parameters) { keydown: function(event) { var pressedKey = event.which, - keys = module.get.shortcutKeys(), isShortcutKey = module.is.inObject(pressedKey, keys) ; if(isShortcutKey) { @@ -1495,21 +1494,6 @@ $.fn.dropdown = function(parameters) { return range.text.length - rangeLength; } }, - shortcutKeys: function() { - return { - backspace : 8, - delimiter : 188, // comma - deleteKey : 46, - enter : 13, - escape : 27, - pageUp : 33, - pageDown : 34, - leftArrow : 37, - upArrow : 38, - rightArrow : 39, - downArrow : 40 - }; - }, value: function() { var value = ($input.length > 0) @@ -3338,6 +3322,20 @@ $.fn.dropdown.settings = { value : 'value' // actual dropdown value }, + keys : { + backspace : 8, + delimiter : 188, // comma + deleteKey : 46, + enter : 13, + escape : 27, + pageUp : 33, + pageDown : 34, + leftArrow : 37, + upArrow : 38, + rightArrow : 39, + downArrow : 40 + }, + selector : { addition : '.addition', dropdown : '.ui.dropdown',