Commit eb20ed7a authored by Oleg.Korshul's avatar Oleg.Korshul

local

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67037 954022d7-b5bf-4e40-9824-e11837661b57
parent ec1b141e
......@@ -105,7 +105,7 @@ CHistory.prototype.Reset_SavedIndex = function(IsUserSave)
}
};
CHistory.prototype.Is_Modified = function(IsUserSave)
CHistory.prototype.Is_Modified = function(IsUserSave, IsNoSavedNoModifyed)
{
var checkIndex = (this.Is_UserSaveMode() && IsUserSave) ? this.UserSavedIndex : this.SavedIndex;
if (-1 === this.Index && null === checkIndex && false === this.ForceSave)
......@@ -114,7 +114,7 @@ CHistory.prototype.Is_Modified = function(IsUserSave)
{
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]())
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]() && IsNoSavedNoModifyed !== true)
return true;
}
return false;
......@@ -133,6 +133,19 @@ window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
window["Asc"]['spreadsheet_api'].prototype.onUpdateDocumentModified = function(bIsModified)
{
// Обновляем только после окончания сохранения
if (this.canSave) {
this.handlers.trigger("asc_onDocumentModifiedChanged", bIsModified);
this._onUpdateDocumentCanSave();
if (undefined !== window["AscDesktopEditor"]) {
window["AscDesktopEditor"]["onDocumentModifiedChanged"](History ? History.Is_Modified(undefined, true) : bValue);
}
}
};
window["Asc"]['spreadsheet_api'].prototype.asc_Save = function (isNoUserSave, isSaveAs)
{
var t = this;
......
......@@ -50,7 +50,7 @@ CHistory.prototype.Reset_SavedIndex = function(IsUserSave)
this.ForceSave = false;
}
};
CHistory.prototype.Have_Changes = function(IsUserSave)
CHistory.prototype.Have_Changes = function(IsUserSave, IsNoSavedNoModifyed)
{
if (true === this.Is_UserSaveMode() && false !== IsUserSave)
{
......@@ -60,7 +60,7 @@ CHistory.prototype.Have_Changes = function(IsUserSave)
{
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]())
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]() && IsNoSavedNoModifyed !== true)
return true;
}
return false;
......@@ -93,6 +93,17 @@ window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
asc_docs_api.prototype.SetDocumentModified = function(bValue)
{
this.isDocumentModify = bValue;
this.asc_fireCallback("asc_onDocumentModifiedChanged");
if (undefined !== window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["onDocumentModifiedChanged"](History ? History.Have_Changes(undefined, true) : bValue);
}
};
asc_docs_api.prototype.asc_Save = function (isNoUserSave, isSaveAs)
{
if (true !== isNoUserSave)
......@@ -166,6 +177,7 @@ asc_docs_api.prototype["AddImage"] = asc_docs_api.prototype.AddImage;
asc_docs_api.prototype["asc_Save"] = asc_docs_api.prototype.asc_Save;
asc_docs_api.prototype["asc_DownloadAs"] = asc_docs_api.prototype.asc_DownloadAs;
asc_docs_api.prototype["asc_isOffline"] = asc_docs_api.prototype.asc_isOffline;
asc_docs_api.prototype["SetDocumentModified"] = asc_docs_api.prototype.SetDocumentModified;
window["DesktopOfflineAppDocumentAddImageEnd"] = function(url)
{
......
......@@ -67,7 +67,7 @@ CHistory.prototype.Reset_SavedIndex = function(IsUserSave)
this.ForceSave = false;
}
};
CHistory.prototype.Have_Changes = function(IsUserSave)
CHistory.prototype.Have_Changes = function(IsUserSave, IsNoSavedNoModifyed)
{
if (true === this.Is_UserSaveMode() && false !== IsUserSave)
{
......@@ -77,7 +77,7 @@ CHistory.prototype.Have_Changes = function(IsUserSave)
{
if (0 != window["AscDesktopEditor"]["LocalFileGetOpenChangesCount"]())
return true;
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]())
if (!window["AscDesktopEditor"]["LocalFileGetSaved"]() && IsNoSavedNoModifyed !== true)
return true;
}
return false;
......@@ -110,6 +110,17 @@ window["DesktopOfflineAppDocumentApplyChanges"] = function(_changes)
/////////////////////////////////////////////////////////
//////////////// SAVE //////////////////////
/////////////////////////////////////////////////////////
asc_docs_api.prototype.SetDocumentModified = function(bValue)
{
this.isDocumentModify = bValue;
this.asc_fireCallback("asc_onDocumentModifiedChanged");
if (undefined !== window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["onDocumentModifiedChanged"](History ? History.Have_Changes(undefined, true) : bValue);
}
};
asc_docs_api.prototype.asc_Save = function (isNoUserSave, isSaveAs)
{
if (true !== isNoUserSave)
......@@ -183,6 +194,7 @@ asc_docs_api.prototype["AddImage"] = asc_docs_api.prototype.AddImage;
asc_docs_api.prototype["asc_Save"] = asc_docs_api.prototype.asc_Save;
asc_docs_api.prototype["asc_DownloadAs"] = asc_docs_api.prototype.asc_DownloadAs;
asc_docs_api.prototype["asc_isOffline"] = asc_docs_api.prototype.asc_isOffline;
asc_docs_api.prototype["SetDocumentModified"] = asc_docs_api.prototype.SetDocumentModified;
window["DesktopOfflineAppDocumentAddImageEnd"] = function(url)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment