Disable scrolling with arrows in Firefox.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-26 19:24:31 -03:00
parent 66fcc68677
commit 65f4238c3e

View File

@ -225,7 +225,7 @@ mindplot.DesignerKeyboard = new Class({
designer.selectAll(); designer.selectAll();
}, },
'right':function () { 'right':function (event) {
var node = model.selectedTopic(); var node = model.selectedTopic();
if (node) { if (node) {
if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
@ -243,9 +243,11 @@ mindplot.DesignerKeyboard = new Class({
var centralTopic = model.getCentralTopic(); var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic); this._goToNode(designer, centralTopic);
} }
event.preventDefault();
event.stopPropagation();
}.bind(this), }.bind(this),
'left':function () { 'left':function (event) {
var node = model.selectedTopic(); var node = model.selectedTopic();
if (node) { if (node) {
if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
@ -263,9 +265,11 @@ mindplot.DesignerKeyboard = new Class({
var centralTopic = model.getCentralTopic(); var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic); this._goToNode(designer, centralTopic);
} }
event.preventDefault();
event.stopPropagation();
}.bind(this), }.bind(this),
'up':function () { 'up':function (event) {
var node = model.selectedTopic(); var node = model.selectedTopic();
if (node) { if (node) {
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
@ -275,9 +279,11 @@ mindplot.DesignerKeyboard = new Class({
var centralTopic = model.getCentralTopic(); var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic); this._goToNode(designer, centralTopic);
} }
event.preventDefault();
event.stopPropagation();
}.bind(this), }.bind(this),
'down':function () { 'down':function (event) {
var node = model.selectedTopic(); var node = model.selectedTopic();
if (node) { if (node) {
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
@ -287,6 +293,8 @@ mindplot.DesignerKeyboard = new Class({
var centralTopic = model.getCentralTopic(); var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic); this._goToNode(designer, centralTopic);
} }
event.preventDefault();
event.stopPropagation();
}.bind(this) }.bind(this)
}; };
this.addEvents(keyboardEvents); this.addEvents(keyboardEvents);