mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
Fix event registration event capture during drag.
This commit is contained in:
parent
56e57cab75
commit
5496b9b076
@ -28,6 +28,10 @@ mindplot.NodeGraph = new Class({
|
||||
this._size = {width:50,height:20};
|
||||
},
|
||||
|
||||
isReadOnly : function(){
|
||||
return this._options.readOnly;
|
||||
},
|
||||
|
||||
getType : function() {
|
||||
var model = this.getModel();
|
||||
return model.getType();
|
||||
|
@ -34,7 +34,7 @@ mindplot.Topic = new Class({
|
||||
}
|
||||
|
||||
// Register events for the topic ...
|
||||
if (!options.readOnly) {
|
||||
if (!this.isReadOnly()) {
|
||||
this._registerEvents();
|
||||
}
|
||||
},
|
||||
@ -50,7 +50,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
this.addEvent('dblclick', function (event) {
|
||||
this._getTopicEventDispatcher().show(this);
|
||||
event.stopPropagation(true);
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
@ -134,7 +134,7 @@ mindplot.Topic = new Class({
|
||||
this._setBorderColor(brColor, false);
|
||||
|
||||
// Define the pointer ...
|
||||
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && !this.isReadOnly()) {
|
||||
this._innerShape.setCursor('move');
|
||||
} else {
|
||||
this._innerShape.setCursor('default');
|
||||
@ -584,6 +584,8 @@ mindplot.Topic = new Class({
|
||||
|
||||
// Focus events ...
|
||||
elem.addEvent('mousedown', function(event) {
|
||||
if (!this.isReadOnly()) {
|
||||
// Disable topic selection of readOnly mode ...
|
||||
var value = true;
|
||||
if ((event.meta && Browser.Platform.mac) || (event.control && !Browser.Platform.mac)) {
|
||||
value = !this.isOnFocus();
|
||||
@ -591,9 +593,12 @@ mindplot.Topic = new Class({
|
||||
event.preventDefault();
|
||||
}
|
||||
topic.setOnFocus(value);
|
||||
}
|
||||
|
||||
var eventDispatcher = this._getTopicEventDispatcher();
|
||||
eventDispatcher.process(mindplot.TopicEvent.CLICK, this);
|
||||
event.stopPropagation();
|
||||
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
@ -48,6 +48,7 @@ mindplot.TopicEventDispatcher = new Class({
|
||||
},
|
||||
|
||||
process : function(eventType, topic, options) {
|
||||
$assert(eventType, "eventType can not be null");
|
||||
|
||||
// Close all previous open editor ....
|
||||
if (this.isVisible()) {
|
||||
|
@ -4,8 +4,7 @@
|
||||
<head>
|
||||
<base href="../">
|
||||
<title>WiseMapping - Editor </title>
|
||||
<meta http-equiv="Content-type" content="text/html; char
|
||||
set=UTF-8"/>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
|
Loading…
Reference in New Issue
Block a user