fix page exits
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div id="notes_box" class="col-9 h-100">
|
||||
<div id="notes_feedback"></div>
|
||||
<form id="notes" method="post"><textarea id="tiny"></textarea></form>
|
||||
<form id="notes" method="post"><i class="fa fa-2x fa-loading" style="position:absolute;"></i><textarea id="tiny"></textarea></form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="template-items">
|
||||
@@ -53,6 +53,7 @@ oCATC.pageInit = function(asHash, bFirstPage) {
|
||||
autosave_interval: "10s",
|
||||
setup: function(ed) {
|
||||
ed.on('init', function(e) {
|
||||
$('.fa-loading').hide();
|
||||
Tools.ajax(
|
||||
'get_note',
|
||||
(asData) => {
|
||||
@@ -107,11 +108,14 @@ oCATC.pageInit = function(asHash, bFirstPage) {
|
||||
};
|
||||
|
||||
oCATC.onSamePageMove = function(asHash) {
|
||||
tinymce.remove();
|
||||
return true;
|
||||
};
|
||||
|
||||
oCATC.onQuitPage = function(sExitMode) {
|
||||
return save(true, (sExitMode==self.consts.exitmodes.closing));
|
||||
save(true, (sExitMode == self.consts.exitmodes.closing));
|
||||
tinymce.remove();
|
||||
return true;
|
||||
};
|
||||
|
||||
function loadDocs() {
|
||||
@@ -175,7 +179,7 @@ function save(bForce, bOnUnload) {
|
||||
var sContent = tinymce.activeEditor.getContent();
|
||||
if(self.tmp('id_course') != 0) {
|
||||
self.tmp('saving', true);
|
||||
noteFeedback('info', 'Saving...');
|
||||
if($.type(noteFeedback)=='function') noteFeedback('info', 'Saving...');
|
||||
Tools.ajax(
|
||||
'set_note',
|
||||
function(asData) {
|
||||
|
||||
Reference in New Issue
Block a user