Do not change active page commit until user reverts the page
This commit is contained in:
parent
80d3a831f3
commit
20b4fc9198
@ -256,6 +256,7 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) {
|
|||||||
window.console.log('Page saved successfully.');
|
window.console.log('Page saved successfully.');
|
||||||
window.wiki_page_content = currentContent;
|
window.wiki_page_content = currentContent;
|
||||||
$('#id_commitMsg').val(''); // Clear the commit message box
|
$('#id_commitMsg').val(''); // Clear the commit message box
|
||||||
|
$('#wiki-get-history').click();
|
||||||
} else {
|
} else {
|
||||||
alert('Error saving page.'); // TODO: Replace alerts with auto-timeout popups
|
alert('Error saving page.'); // TODO: Replace alerts with auto-timeout popups
|
||||||
window.console.log('Error saving page.');
|
window.console.log('Error saving page.');
|
||||||
@ -301,6 +302,7 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) {
|
|||||||
$('#revert-'+commitHash).removeClass('btn-danger');
|
$('#revert-'+commitHash).removeClass('btn-danger');
|
||||||
$('#revert-'+commitHash).addClass('btn-success');
|
$('#revert-'+commitHash).addClass('btn-success');
|
||||||
$('#revert-'+commitHash).html('Page reverted<br>but not saved');
|
$('#revert-'+commitHash).html('Page reverted<br>but not saved');
|
||||||
|
window.wiki_page_commit = commitHash;
|
||||||
// put contents in editor
|
// put contents in editor
|
||||||
editor.getSession().setValue(data.content);
|
editor.getSession().setValue(data.content);
|
||||||
} else {
|
} else {
|
||||||
@ -323,7 +325,6 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) {
|
|||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
window.wiki_page_commit = compareCommit;
|
|
||||||
var modalBody = $('#generic-modal-body-{{$wikiModalID}}');
|
var modalBody = $('#generic-modal-body-{{$wikiModalID}}');
|
||||||
modalBody.html('<div class="descriptive-text">'+data.diff+'</div>');
|
modalBody.html('<div class="descriptive-text">'+data.diff+'</div>');
|
||||||
$('.modal-dialog').width('80%');
|
$('.modal-dialog').width('80%');
|
||||||
|
Reference in New Issue
Block a user