From 5e2f10d72ff3c25565141f7e5357857e14480fb7 Mon Sep 17 00:00:00 2001 From: Arpad Csanyi Date: Wed, 11 May 2016 23:31:28 +0200 Subject: [PATCH] Add event handler for switching between mouse actions. --- script.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/script.js b/script.js index c9dd1a8b..f4080017 100644 --- a/script.js +++ b/script.js @@ -353,6 +353,17 @@ $(function() { }); }; _keypress_event_handlers(); + + var _mouse_event_handlers = function() { + $('.mouse__action--type').on('click', 'a', function(e) { + var _this = $(this), + _mouse_config_name = _this.data('config'); + $('.mouse__config').hide(); + $('.mouse__config--' + _mouse_config_name).show(); + $('.mouse__action--type li').removeClass('active'); + _this.parents('li').addClass('active'); + }); + } });