From a2c5e3001176bc6162d1aaf791152df9725b5fa2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 12 Dec 2016 13:09:27 +0100 Subject: wiki: indicate saved state for bbcode type --- view/tpl/wiki.tpl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'view') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index bc5717fea..a84209b37 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -62,7 +62,7 @@
- +
@@ -178,7 +178,6 @@ else { adjustInlineEditorHeight(); } - }, 500); // Return the focus to the editor allowing immediate text entry $('#page-tools').show(); }); @@ -252,6 +251,7 @@ {{/if}} if (window.wiki_page_content === currentContent) { + $('#save-page').addClass('disabled'); // Disable the save button window.console.log('No edits to save.'); ev.preventDefault(); return false; @@ -267,9 +267,8 @@ window.console.log('Page saved successfully.'); window.wiki_page_content = currentContent; $('#id_commitMsg').val(''); // Clear the commit message box - - {{if !$mimeType || $mimeType == 'text/markdown'}} $('#save-page').addClass('disabled'); // Disable the save button + {{if !$mimeType || $mimeType == 'text/markdown'}} window.editor.getSession().getUndoManager().markClean(); // Reset the undo history for the editor {{/if}} @@ -454,9 +453,6 @@ $(document).ready(function () { wiki_refresh_page_list(); - // This seems obsolete - // Show Edit tab first. Otherwise the Ace editor does not load. - //$("#wiki-nav-tabs li:eq(1) a").tab('show'); {{if !$mimeType || $mimeType == 'text/markdown'}} $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); @@ -468,6 +464,9 @@ } }); {{else}} + window.editor.on("input", function() { + $('#save-page').removeClass('disabled'); + }); window.editor.bbco_autocomplete('bbcode'); {{/if}} }); -- cgit v1.2.3