Fixes template editor to re-enable ajax saving - might need back porting to 6.2
This commit is contained in:
@@ -15,12 +15,13 @@
|
||||
<umb:JsInclude ID="JsInclude" runat="server" FilePath="splitbutton/jquery.splitbutton.js" PathNameAlias="UmbracoClient" />
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="Editors/EditTemplate.js" PathNameAlias="UmbracoClient" />
|
||||
<script type="text/javascript">
|
||||
//this needs to be a global object for the doSubmit() to work
|
||||
var editor;
|
||||
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
//create the editor
|
||||
editor = new Umbraco.Editors.EditTemplate({
|
||||
var editor = new Umbraco.Editors.EditTemplate({
|
||||
templateAliasClientId: '<%= AliasTxt.ClientID %>',
|
||||
templateNameClientId: '<%= NameTxt.ClientID %>',
|
||||
saveButton: $("#<%= ((Control)SaveButton).ClientID %>"),
|
||||
restServiceLocation: "<%= Url.GetSaveFileServicePath() %>",
|
||||
umbracoPath: '<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>',
|
||||
editorClientId: '<%= editorSource.ClientID %>',
|
||||
@@ -39,12 +40,7 @@
|
||||
|
||||
editor.init();
|
||||
});
|
||||
|
||||
function doSubmit() {
|
||||
//this is called when the save button is clicked or invoked
|
||||
editor.save(jQuery('#<%= NameTxt.ClientID %>').val(), jQuery('#<%= AliasTxt.ClientID %>').val(), UmbEditor.GetCode());
|
||||
}
|
||||
|
||||
|
||||
//TODO: the below should be refactored into being part of the EditTemplate.js class but have left it here for now since i don't have time.
|
||||
|
||||
function umbracoTemplateInsertMasterPageContentContainer() {
|
||||
|
||||
@@ -77,6 +77,12 @@
|
||||
|
||||
var self = this;
|
||||
|
||||
//bind to the save event
|
||||
this._opts.saveButton.click(function (event) {
|
||||
event.preventDefault();
|
||||
self.doSubmit();
|
||||
});
|
||||
|
||||
$("#sb").click(function() {
|
||||
self._insertCodeBlock();
|
||||
});
|
||||
@@ -106,6 +112,10 @@
|
||||
});
|
||||
},
|
||||
|
||||
doSubmit: function() {
|
||||
this.save(jQuery('#' + this._opts.templateNameClientId).val(), jQuery('#' + this._opts.templateAliasClientId).val(), UmbEditor.GetCode());
|
||||
},
|
||||
|
||||
save: function(templateName, templateAlias, codeVal) {
|
||||
var self = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user