From bc13cf2588c5311172ce0420c3f9a5ee85c95e1c Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Thu, 1 Dec 2011 00:28:09 +0000 Subject: [PATCH] Made buttons not change focus --- modules/es/tools/es.ButtonTool.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/es/tools/es.ButtonTool.js b/modules/es/tools/es.ButtonTool.js index 9ea4ef5087..e11576f4b8 100644 --- a/modules/es/tools/es.ButtonTool.js +++ b/modules/es/tools/es.ButtonTool.js @@ -10,8 +10,18 @@ es.ButtonTool = function( toolbar, name ) { var _this = this; - this.$.click( function ( e ) { - _this.onClick( e ); + this.$.bind( { + 'mousedown': function( e ) { + if ( e.button === 0 ) { + e.preventDefault(); + return false; + } + }, + 'mouseup': function ( e ) { + if ( e.button === 0 ) { + _this.onClick( e ); + } + } } ); };