From 128db4bf484b8637d73dcd383a2db8351b48012e Mon Sep 17 00:00:00 2001 From: Arpad Csanyi Date: Wed, 11 May 2016 23:32:19 +0200 Subject: [PATCH] Call the new mouse event handler function. Also apply some refactoring on the code for better readability. --- script.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index f4080017..c828c899 100644 --- a/script.js +++ b/script.js @@ -316,11 +316,19 @@ $(function() { var contentTemplate = Handlebars.compile(contentSource); $('#key-editor-content__target').html(contentTemplate(contentContext[tplName])); var noSearch = false; - if (tplName == "layer") { - noSearch = true; + switch (tplName) { + case 'layer': + noSearch = true; + + case 'keypress': + _keypress_event_handlers(); + + case 'mouse': + _mouse_event_handlers(); + + default: + initSelect2items(noSearch); } - initSelect2items(noSearch); - _keypress_event_handlers(); });