Stop using setViewModeDisconnect in OO

pull/1/head
yflory 4 years ago
parent b709b7a31b
commit 657b9e347b

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

Loading…
Cancel
Save