From 65f4238c3e74f267f096cfaffe8262e2ac167404 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 26 Sep 2012 19:24:31 -0300 Subject: [PATCH] Disable scrolling with arrows in Firefox. --- mindplot/src/main/javascript/DesignerKeyboard.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index df992657..49ce9ca9 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -225,7 +225,7 @@ mindplot.DesignerKeyboard = new Class({ designer.selectAll(); }, - 'right':function () { + 'right':function (event) { var node = model.selectedTopic(); if (node) { if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { @@ -243,9 +243,11 @@ mindplot.DesignerKeyboard = new Class({ var centralTopic = model.getCentralTopic(); this._goToNode(designer, centralTopic); } + event.preventDefault(); + event.stopPropagation(); }.bind(this), - 'left':function () { + 'left':function (event) { var node = model.selectedTopic(); if (node) { if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { @@ -263,9 +265,11 @@ mindplot.DesignerKeyboard = new Class({ var centralTopic = model.getCentralTopic(); this._goToNode(designer, centralTopic); } + event.preventDefault(); + event.stopPropagation(); }.bind(this), - 'up':function () { + 'up':function (event) { var node = model.selectedTopic(); if (node) { if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { @@ -275,9 +279,11 @@ mindplot.DesignerKeyboard = new Class({ var centralTopic = model.getCentralTopic(); this._goToNode(designer, centralTopic); } + event.preventDefault(); + event.stopPropagation(); }.bind(this), - 'down':function () { + 'down':function (event) { var node = model.selectedTopic(); if (node) { if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { @@ -287,6 +293,8 @@ mindplot.DesignerKeyboard = new Class({ var centralTopic = model.getCentralTopic(); this._goToNode(designer, centralTopic); } + event.preventDefault(); + event.stopPropagation(); }.bind(this) }; this.addEvents(keyboardEvents);