Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
1f94bf50
Commit
1f94bf50
authored
8 years ago
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move change theme to model
parent
c26e1c3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
cell/api.js
cell/api.js
+2
-16
cell/model/UndoRedo.js
cell/model/UndoRedo.js
+1
-0
cell/model/Workbook.js
cell/model/Workbook.js
+18
-0
No files found.
cell/api.js
View file @
1f94bf50
...
...
@@ -2887,22 +2887,9 @@ var editor;
var
t
=
this
;
var
onChangeColorScheme
=
function
(
res
)
{
if
(
res
)
{
var
theme
=
t
.
wbModel
.
theme
;
var
scheme
=
AscCommon
.
getColorThemeByIndex
(
index
);
if
(
!
scheme
)
{
index
-=
AscCommon
.
g_oUserColorScheme
.
length
;
if
(
index
<
0
||
index
>=
theme
.
extraClrSchemeLst
.
length
)
{
return
;
}
scheme
=
theme
.
extraClrSchemeLst
[
index
].
clrScheme
.
createDuplicate
();
if
(
t
.
wbModel
.
changeColorScheme
(
index
))
{
t
.
asc_AfterChangeColorScheme
();
}
History
.
Create_NewPoint
();
//не делаем Duplicate потому что предполагаем что схема не будет менять частями, а только обьектом целиком.
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoWorkbook
,
AscCH
.
historyitem_Workbook_ChangeColorScheme
,
null
,
null
,
new
AscCommonExcel
.
UndoRedoData_ClrScheme
(
theme
.
themeElements
.
clrScheme
,
scheme
));
theme
.
themeElements
.
clrScheme
=
scheme
;
t
.
asc_AfterChangeColorScheme
();
}
};
// ToDo поправить заглушку, сделать новый тип lock element-а
...
...
@@ -2912,7 +2899,6 @@ var editor;
this
.
_getIsLockObjectSheet
(
lockInfo
,
onChangeColorScheme
);
};
spreadsheet_api
.
prototype
.
asc_AfterChangeColorScheme
=
function
()
{
this
.
wbModel
.
rebuildColors
();
this
.
asc_CheckGuiControlColors
();
this
.
asc_ApplyColorScheme
(
true
);
};
...
...
This diff is collapsed.
Click to expand it.
cell/model/UndoRedo.js
View file @
1f94bf50
...
...
@@ -2868,6 +2868,7 @@ UndoRedoWorkbook.prototype = {
wb
.
theme
.
themeElements
.
clrScheme
=
Data
.
oldVal
;
else
wb
.
theme
.
themeElements
.
clrScheme
=
Data
.
newVal
;
wb
.
rebuildColors
();
wb
.
oApi
.
asc_AfterChangeColorScheme
();
}
else
if
(
AscCH
.
historyitem_Workbook_DefinedNamesChange
===
Type
||
AscCH
.
historyitem_Workbook_DefinedNamesChangeUndo
===
Type
)
{
...
...
This diff is collapsed.
Click to expand it.
cell/model/Workbook.js
View file @
1f94bf50
...
...
@@ -2248,6 +2248,24 @@
var
sheetId
=
this
.
getSheetIdByIndex
(
ascName
.
LocalSheetId
);
return
new
UndoRedoData_DefinedNames
(
ascName
.
Name
,
ascName
.
Ref
,
sheetId
,
ascName
.
isTable
);
};
Workbook
.
prototype
.
changeColorScheme
=
function
(
index
)
{
var
scheme
=
AscCommon
.
getColorThemeByIndex
(
index
);
if
(
!
scheme
)
{
index
-=
AscCommon
.
g_oUserColorScheme
.
length
;
if
(
index
<
0
||
index
>=
this
.
theme
.
extraClrSchemeLst
.
length
)
{
return
false
;
}
scheme
=
this
.
theme
.
extraClrSchemeLst
[
index
].
clrScheme
.
createDuplicate
();
}
History
.
Create_NewPoint
();
//не делаем Duplicate потому что предполагаем что схема не будет менять частями, а только обьектом целиком.
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoWorkbook
,
AscCH
.
historyitem_Workbook_ChangeColorScheme
,
null
,
null
,
new
AscCommonExcel
.
UndoRedoData_ClrScheme
(
this
.
theme
.
themeElements
.
clrScheme
,
scheme
));
this
.
theme
.
themeElements
.
clrScheme
=
scheme
;
this
.
rebuildColors
();
return
true
;
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment