|
@@ -8,12 +8,10 @@
|
|
* @param script javascript object
|
|
* @param script javascript object
|
|
* @param attributeName string
|
|
* @param attributeName string
|
|
* @param newValue string, object
|
|
* @param newValue string, object
|
|
- * @param cursorPosition javascript object with format {line: 2, ch: 3}
|
|
|
|
- * @param scrollInfo javascript object with values {left, top, width, height, clientWidth, clientHeight}
|
|
|
|
* @constructor
|
|
* @constructor
|
|
*/
|
|
*/
|
|
|
|
|
|
-var SetScriptValueCommand = function ( object, script, attributeName, newValue, cursorPosition, scrollInfo ) {
|
|
|
|
|
|
+var SetScriptValueCommand = function ( object, script, attributeName, newValue ) {
|
|
|
|
|
|
Command.call( this );
|
|
Command.call( this );
|
|
|
|
|
|
@@ -27,8 +25,6 @@ var SetScriptValueCommand = function ( object, script, attributeName, newValue,
|
|
this.attributeName = attributeName;
|
|
this.attributeName = attributeName;
|
|
this.oldValue = ( script !== undefined ) ? script[ this.attributeName ] : undefined;
|
|
this.oldValue = ( script !== undefined ) ? script[ this.attributeName ] : undefined;
|
|
this.newValue = newValue;
|
|
this.newValue = newValue;
|
|
- this.cursorPosition = cursorPosition;
|
|
|
|
- this.scrollInfo = scrollInfo;
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -39,7 +35,6 @@ SetScriptValueCommand.prototype = {
|
|
this.script[ this.attributeName ] = this.newValue;
|
|
this.script[ this.attributeName ] = this.newValue;
|
|
|
|
|
|
this.editor.signals.scriptChanged.dispatch();
|
|
this.editor.signals.scriptChanged.dispatch();
|
|
- this.editor.signals.refreshScriptEditor.dispatch( this.object, this.script, this.cursorPosition, this.scrollInfo );
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -48,14 +43,11 @@ SetScriptValueCommand.prototype = {
|
|
this.script[ this.attributeName ] = this.oldValue;
|
|
this.script[ this.attributeName ] = this.oldValue;
|
|
|
|
|
|
this.editor.signals.scriptChanged.dispatch();
|
|
this.editor.signals.scriptChanged.dispatch();
|
|
- this.editor.signals.refreshScriptEditor.dispatch( this.object, this.script, this.cursorPosition, this.scrollInfo );
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
update: function ( cmd ) {
|
|
update: function ( cmd ) {
|
|
|
|
|
|
- this.cursorPosition = cmd.cursorPosition;
|
|
|
|
- this.scrollInfo = cmd.scrollInfo;
|
|
|
|
this.newValue = cmd.newValue;
|
|
this.newValue = cmd.newValue;
|
|
|
|
|
|
},
|
|
},
|
|
@@ -69,8 +61,6 @@ SetScriptValueCommand.prototype = {
|
|
output.attributeName = this.attributeName;
|
|
output.attributeName = this.attributeName;
|
|
output.oldValue = this.oldValue;
|
|
output.oldValue = this.oldValue;
|
|
output.newValue = this.newValue;
|
|
output.newValue = this.newValue;
|
|
- output.cursorPosition = this.cursorPosition;
|
|
|
|
- output.scrollInfo = this.scrollInfo;
|
|
|
|
|
|
|
|
return output;
|
|
return output;
|
|
|
|
|
|
@@ -85,8 +75,6 @@ SetScriptValueCommand.prototype = {
|
|
this.attributeName = json.attributeName;
|
|
this.attributeName = json.attributeName;
|
|
this.object = this.editor.objectByUuid( json.objectUuid );
|
|
this.object = this.editor.objectByUuid( json.objectUuid );
|
|
this.script = this.editor.scripts[ json.objectUuid ][ json.index ];
|
|
this.script = this.editor.scripts[ json.objectUuid ][ json.index ];
|
|
- this.cursorPosition = json.cursorPosition;
|
|
|
|
- this.scrollInfo = json.scrollInfo;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|