Merge branch 'pynej-view-save-restore-cursor' into dev-v7
This commit is contained in:
@@ -35,9 +35,18 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls.CodeEditor");
|
||||
this._control.val(code);
|
||||
}
|
||||
else {
|
||||
//this is a wrapper for CodeMirror
|
||||
//this is a wrapper for CodeMirror
|
||||
this._editor.focus();
|
||||
|
||||
var codeChanged = this._editor.getValue() != code;
|
||||
var cursor = this._editor.doc.getCursor();
|
||||
|
||||
this._editor.setValue(code);
|
||||
|
||||
// Restore cursor position if the server saved code matches.
|
||||
if (!codeChanged)
|
||||
this._editor.setCursor(cursor);
|
||||
|
||||
this._editor.focus();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
}
|
||||
if (args.contents) {
|
||||
UmbEditor.SetCode(args.contents);
|
||||
} else if (!this.IsSimpleEditor) {
|
||||
// Restore focuse to text region. SetCode also does this.
|
||||
UmbEditor._editor.focus();
|
||||
}
|
||||
|
||||
UmbClientMgr.mainTree().setActiveTreeType(this._opts.currentTreeType);
|
||||
|
||||
Reference in New Issue
Block a user