From 93b543e878459b81211cdb41269e2e4d36a4a74b Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 12 Jul 2016 11:13:15 -0300 Subject: [PATCH] disable mousewheel on numeric input fields --- public/views/walletHome.html | 8 ++++---- src/js/directives/directives.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index cfbecd318..721471874 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -427,8 +427,8 @@ Amount
- - + + {{home.unitName}}
@@ -436,8 +436,8 @@
- - + + {{ home.alternativeIsoCode }}
diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js index 491cebf64..a73b74b5e 100644 --- a/src/js/directives/directives.js +++ b/src/js/directives/directives.js @@ -325,4 +325,17 @@ angular.module('copayApp.directives') replace: true, templateUrl: 'views/includes/available-balance.html' } + }) + .directive('ignoreMouseWheel', function($rootScope, $timeout) { + return { + restrict: 'A', + link: function(scope, element, attrs) { + element.bind('mousewheel', function(event) { + element[0].blur(); + $timeout(function() { + element[0].focus(); + }, 1); + }); + } + } });