Stop using setViewModeDisconnect in OO

This commit is contained in:
yflory 2021-04-01 10:58:14 +02:00
parent b709b7a31b
commit 657b9e347b

View file

@ -1350,7 +1350,7 @@ define([
// Migration required but read-only: continue...
if (readOnly) {
setEditable(true);
getEditor().setViewModeDisconnect();
try { getEditor().asc_setRestriction(true); } catch (e) {}
} else {
// No changes after the cp: migrate now
onMigrateRdy.fire();
@ -1376,9 +1376,7 @@ define([
}
if (lock || readOnly) {
try {
getEditor().asc_setRestriction(true);
} catch (e) {}
try { getEditor().asc_setRestriction(true); } catch (e) {}
//getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup
} else {
setEditable(true);
@ -1408,7 +1406,8 @@ define([
}
if (APP.template) {
getEditor().setViewModeDisconnect();
try { getEditor().asc_setRestriction(true); } catch (e) {}
//getEditor().setViewModeDisconnect();
UI.removeLoadingScreen();
makeCheckpoint(true);
return;
@ -1977,7 +1976,7 @@ define([
UI.removeModals();
UI.confirm(Messages.oo_uploaded, function (yes) {
try {
getEditor().setViewModeDisconnect();
getEditor().asc_setRestriction(true);
} catch (e) {}
if (!yes) { return; }
common.gotoURL();
@ -2143,7 +2142,9 @@ define([
APP.history = true;
APP.template = true;
var editor = getEditor();
if (editor) { editor.setViewModeDisconnect(); }
if (editor) {
try { getEditor().asc_setRestriction(true); } catch (e) {}
}
var content = parsed.content;
// Get checkpoint
@ -2282,7 +2283,7 @@ define([
var setHistoryMode = function (bool) {
if (bool) {
APP.history = true;
getEditor().setViewModeDisconnect();
try { getEditor().asc_setRestriction(true); } catch (e) {}
return;
}
// Cancel button: redraw from lastCp