mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-29 09:04:54 +01:00
- Minor fixes
This commit is contained in:
parent
3d1dc9bfc6
commit
4a0d70e3b3
@ -18,22 +18,21 @@
|
||||
|
||||
mindplot.commands.DragTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize:function (topicIds, position, order, parentTopic) {
|
||||
$assert(topicIds, "topicIds must be defined");
|
||||
initialize:function (topicId, position, order, parentTopic) {
|
||||
$assert(topicId, "topicId must be defined");
|
||||
|
||||
this._topicsIds = topicIds;
|
||||
this._topicsId = topicId;
|
||||
if ($defined(parentTopic))
|
||||
this._parentId = parentTopic.getId();
|
||||
|
||||
this.parent();
|
||||
this._position = position;
|
||||
this._order = order;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
|
||||
execute:function (commandContext) {
|
||||
|
||||
var topic = commandContext.findTopics([this._topicsIds])[0];
|
||||
var topic = commandContext.findTopics(this._topicsId)[0];
|
||||
|
||||
// Save old position ...
|
||||
var origParentTopic = topic.getOutgoingConnectedTopic();
|
||||
@ -60,7 +59,7 @@ mindplot.commands.DragTopicCommand = new Class({
|
||||
if (origParentTopic != this._parentId) {
|
||||
|
||||
if ($defined(this._parentId)) {
|
||||
var parentTopic = commandContext.findTopics([this._parentId])[0];
|
||||
var parentTopic = commandContext.findTopics(this._parentId)[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
|
||||
|
@ -24,14 +24,14 @@ mindplot.commands.GenericFunctionCommand = new Class({
|
||||
|
||||
this.parent();
|
||||
this._value = value;
|
||||
this._topicsIds = topicsIds;
|
||||
this._topicsId = topicsIds;
|
||||
this._commandFunc = commandFunc;
|
||||
this._oldValues = [];
|
||||
},
|
||||
|
||||
execute: function(commandContext) {
|
||||
if (!this.applied) {
|
||||
var topics = commandContext.findTopics(this._topicsIds);
|
||||
var topics = commandContext.findTopics(this._topicsId);
|
||||
topics.each(function(topic) {
|
||||
var oldValue = this._commandFunc(topic, this._value);
|
||||
this._oldValues.push(oldValue);
|
||||
@ -45,7 +45,7 @@ mindplot.commands.GenericFunctionCommand = new Class({
|
||||
|
||||
undoExecute: function(commandContext) {
|
||||
if (this.applied) {
|
||||
var topics = commandContext.findTopics(this._topicsIds);
|
||||
var topics = commandContext.findTopics(this._topicsId);
|
||||
topics.each(function(topic, index) {
|
||||
this._commandFunc(topic, this._oldValues[index]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user