Fixes issue with wrapping the UmbEditor init in doc ready causing template editing not to work.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
},
|
||||
|
||||
doSubmit: function () {
|
||||
var codeVal = UmbEditor.GetCode();
|
||||
var codeVal = UmbClientMgr.contentFrame().UmbEditor.GetCode();
|
||||
var self = this;
|
||||
|
||||
umbraco.presentation.webservices.codeEditorSave.SaveTemplate(
|
||||
@@ -59,7 +59,7 @@
|
||||
changeMasterPageFile: function ( ) {
|
||||
//var editor = document.getElementById(this._opts.sourceEditorId);
|
||||
var templateDropDown = this._opts.masterPageDropDown.get(0);
|
||||
var templateCode = UmbEditor.GetCode();
|
||||
var templateCode = UmbClientMgr.contentFrame().UmbEditor.GetCode();
|
||||
var newValue = templateDropDown.options[templateDropDown.selectedIndex].id;
|
||||
|
||||
var layoutDefRegex = new RegExp("(@{[\\s\\S]*?Layout\\s*?=\\s*?)(\"[^\"]*?\"|null)(;[\\s\\S]*?})", "gi");
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
UmbEditor.SetCode(templateCode);
|
||||
UmbClientMgr.contentFrame().UmbEditor.SetCode(templateCode);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -170,10 +170,13 @@ namespace umbraco.uicontrols
|
||||
OffSetX += 20;
|
||||
}
|
||||
|
||||
jsEventCode += @"
|
||||
$(function () {
|
||||
jsEventCode += @"
|
||||
//TODO: for now this is a global var, need to refactor all this so that is using proper js standards
|
||||
//with correct objects, and proper accessors to these objects.
|
||||
var UmbEditor;
|
||||
$(document).ready(function () {
|
||||
//create the editor
|
||||
var UmbEditor = new Umbraco.Controls.CodeEditor.UmbracoEditor(" + (!CodeMirrorEnabled).ToString().ToLower() + @", '" + this.ClientID + @"');
|
||||
UmbEditor = new Umbraco.Controls.CodeEditor.UmbracoEditor(" + (!CodeMirrorEnabled).ToString().ToLower() + @", '" + this.ClientID + @"');
|
||||
var m_textEditor = jQuery('#" + this.ClientID + @"');
|
||||
|
||||
//with codemirror adding divs for line numbers, we need to target a different element
|
||||
|
||||
Reference in New Issue
Block a user