From 0127891f3c7c98508dc67712d70d9dc6f27c4307 Mon Sep 17 00:00:00 2001 From: Arpad Csanyi Date: Sun, 15 May 2016 17:39:33 +0200 Subject: [PATCH] Add experimental stateful behaviour to the mouse config interface. --- sass/style.scss | 8 ++++++++ script.js | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/sass/style.scss b/sass/style.scss index 1b292ca4..fc2c5af5 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -134,10 +134,18 @@ a { border-top-right-radius: 0; border-bottom-right-radius: 0; + + &.selected { + font-style: italic; + } } &.active { a { + &.selected { + font-style: normal; + } + &:after { content: ''; display: block; diff --git a/script.js b/script.js index c828c899..32e47655 100644 --- a/script.js +++ b/script.js @@ -371,6 +371,18 @@ $(function() { $('.mouse__action--type li').removeClass('active'); _this.parents('li').addClass('active'); }); + + $('.mouse__action--config').on('click', '.btn', function(e) { + var _buttons = $('.mouse__action--config .btn'), + _mouseActionTypes = $('.mouse__action--type a'), + _currentMouseAction = $('.mouse__action--type li.active a'), + _this = $(this); + + _buttons.removeClass('btn-primary'); + _this.addClass('btn-primary'); + _mouseActionTypes.removeClass('selected'); + _currentMouseAction.addClass('selected'); + }); } });