|
|
@ -221,6 +221,10 @@ define([
|
|
|
|
evStart.reg(function () { toolbar.deleted(); });
|
|
|
|
evStart.reg(function () { toolbar.deleted(); });
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case STATE.READY: {
|
|
|
|
|
|
|
|
evStart.reg(function () { toolbar.ready(); });
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var isEditable = (state === STATE.READY && !unsyncMode);
|
|
|
|
var isEditable = (state === STATE.READY && !unsyncMode);
|
|
|
@ -479,7 +483,7 @@ define([
|
|
|
|
sframeChan.event("EV_CORRUPTED_CACHE");
|
|
|
|
sframeChan.event("EV_CORRUPTED_CACHE");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var onCacheReady = function () {
|
|
|
|
var onCacheReady = function () {
|
|
|
|
stateChange(STATE.DISCONNECTED);
|
|
|
|
stateChange(STATE.INITIALIZING);
|
|
|
|
toolbar.offline(true);
|
|
|
|
toolbar.offline(true);
|
|
|
|
var newContentStr = cpNfInner.chainpad.getUserDoc();
|
|
|
|
var newContentStr = cpNfInner.chainpad.getUserDoc();
|
|
|
|
if (toolbar) {
|
|
|
|
if (toolbar) {
|
|
|
@ -526,7 +530,6 @@ define([
|
|
|
|
var privateDat = cpNfInner.metadataMgr.getPrivateData();
|
|
|
|
var privateDat = cpNfInner.metadataMgr.getPrivateData();
|
|
|
|
var type = privateDat.app;
|
|
|
|
var type = privateDat.app;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// contentUpdate may be async so we need an nthen here
|
|
|
|
// contentUpdate may be async so we need an nthen here
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
if (!newPad) {
|
|
|
|
if (!newPad) {
|
|
|
@ -783,7 +786,7 @@ define([
|
|
|
|
onRemote: onRemote,
|
|
|
|
onRemote: onRemote,
|
|
|
|
onLocal: onLocal,
|
|
|
|
onLocal: onLocal,
|
|
|
|
onInit: onInit,
|
|
|
|
onInit: onInit,
|
|
|
|
onCacheReady: onCacheReady,
|
|
|
|
onCacheReady: function () { evStart.reg(onCacheReady); },
|
|
|
|
onReady: function () { evStart.reg(onReady); },
|
|
|
|
onReady: function () { evStart.reg(onReady); },
|
|
|
|
onConnectionChange: onConnectionChange,
|
|
|
|
onConnectionChange: onConnectionChange,
|
|
|
|
onError: onError,
|
|
|
|
onError: onError,
|
|
|
|