From 20b4fc919871433df6111cbb8b3508fd1693123b Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Mon, 20 Jun 2016 13:05:18 -0400 Subject: Do not change active page commit until user reverts the page --- view/tpl/wiki.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'view/tpl') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 990e6c883..aa0b88545 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -256,6 +256,7 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) { window.console.log('Page saved successfully.'); window.wiki_page_content = currentContent; $('#id_commitMsg').val(''); // Clear the commit message box + $('#wiki-get-history').click(); } else { alert('Error saving page.'); // TODO: Replace alerts with auto-timeout popups window.console.log('Error saving page.'); @@ -301,6 +302,7 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) { $('#revert-'+commitHash).removeClass('btn-danger'); $('#revert-'+commitHash).addClass('btn-success'); $('#revert-'+commitHash).html('Page reverted
but not saved'); + window.wiki_page_commit = commitHash; // put contents in editor editor.getSession().setValue(data.content); } else { @@ -323,7 +325,6 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) { }, function (data) { if (data.success) { - window.wiki_page_commit = compareCommit; var modalBody = $('#generic-modal-body-{{$wikiModalID}}'); modalBody.html('
'+data.diff+'
'); $('.modal-dialog').width('80%'); -- cgit v1.2.3