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
fb02de37
Commit
fb02de37
authored
Jun 05, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ShowSolved comments flag
parent
01d34798
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
24 deletions
+38
-24
cell/api.js
cell/api.js
+3
-3
cell/model/CellComment.js
cell/model/CellComment.js
+23
-14
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+12
-7
No files found.
cell/api.js
View file @
fb02de37
...
...
@@ -2377,11 +2377,11 @@ var editor;
return
this
.
wb
.
cellCommentator
.
getDocumentComments
();
};
spreadsheet_api
.
prototype
.
asc_showComments
=
function
()
{
this
.
wb
.
showComments
(
true
);
spreadsheet_api
.
prototype
.
asc_showComments
=
function
(
isShowSolved
)
{
this
.
wb
.
showComments
(
true
,
isShowSolved
);
};
spreadsheet_api
.
prototype
.
asc_hideComments
=
function
()
{
this
.
wb
.
showComments
(
false
);
this
.
wb
.
showComments
(
false
,
false
);
};
// Shapes
...
...
cell/model/CellComment.js
View file @
fb02de37
...
...
@@ -522,7 +522,7 @@ CCellCommentator.prototype.getCommentsXY = function(x, y) {
CCellCommentator
.
prototype
.
drawCommentCells
=
function
()
{
if
(
this
.
isViewerMode
()
||
this
.
model
.
workbook
.
handlers
.
trigger
(
'
hiddenComments
'
))
{
if
(
this
.
isViewerMode
()
||
this
.
hiddenComments
(
))
{
return
;
}
...
...
@@ -531,7 +531,8 @@ CCellCommentator.prototype.getCommentsXY = function(x, y) {
var
aComments
=
this
.
model
.
aComments
;
for
(
var
i
=
0
;
i
<
aComments
.
length
;
++
i
)
{
commentCell
=
aComments
[
i
];
if
(
commentCell
.
asc_getDocumentFlag
()
||
commentCell
.
asc_getHiddenFlag
()
||
commentCell
.
asc_getSolved
())
{
if
(
commentCell
.
asc_getDocumentFlag
()
||
commentCell
.
asc_getHiddenFlag
()
||
(
commentCell
.
asc_getSolved
()
&&
!
this
.
showSolved
()))
{
continue
;
}
...
...
@@ -944,15 +945,16 @@ CCellCommentator.prototype.getCommentsCoords = function(comments) {
return
coords
;
};
CCellCommentator
.
prototype
.
cleanSelectedComment
=
function
()
{
var
metrics
;
if
(
this
.
lastSelectedId
)
{
var
comment
=
this
.
findComment
(
this
.
lastSelectedId
);
if
(
comment
&&
!
comment
.
asc_getDocumentFlag
()
&&
!
comment
.
asc_getSolved
()
&&
(
metrics
=
this
.
worksheet
.
getCellMetrics
(
comment
.
asc_getCol
(),
comment
.
asc_getRow
())))
this
.
overlayCtx
.
clearRect
(
metrics
.
left
,
metrics
.
top
,
metrics
.
width
,
metrics
.
height
);
}
};
CCellCommentator
.
prototype
.
cleanSelectedComment
=
function
()
{
var
metrics
;
if
(
this
.
lastSelectedId
)
{
var
comment
=
this
.
findComment
(
this
.
lastSelectedId
);
if
(
comment
&&
!
comment
.
asc_getDocumentFlag
()
&&
(
this
.
showSolved
()
||
!
comment
.
asc_getSolved
())
&&
(
metrics
=
this
.
worksheet
.
getCellMetrics
(
comment
.
asc_getCol
(),
comment
.
asc_getRow
())))
{
this
.
overlayCtx
.
clearRect
(
metrics
.
left
,
metrics
.
top
,
metrics
.
width
,
metrics
.
height
);
}
}
};
//-----------------------------------------------------------------------------------
// Misc methods
...
...
@@ -1010,7 +1012,7 @@ CCellCommentator.prototype.selectComment = function(id, bMove) {
this
.
cleanLastSelection
();
this
.
lastSelectedId
=
null
;
if
(
comment
&&
!
comment
.
asc_getDocumentFlag
()
&&
!
comment
.
asc_getSolved
(
))
{
if
(
comment
&&
!
comment
.
asc_getDocumentFlag
()
&&
(
this
.
showSolved
()
||
!
comment
.
asc_getSolved
()
))
{
this
.
lastSelectedId
=
id
;
...
...
@@ -1157,7 +1159,7 @@ CCellCommentator.prototype.removeComment = function(id, bNoEvent, bNoAscLock, bN
var
aComments
=
this
.
model
.
aComments
;
var
length
=
aComments
.
length
;
if
(
this
.
model
.
workbook
.
handlers
.
trigger
(
'
hiddenComments
'
))
{
if
(
this
.
hiddenComments
(
))
{
return
comments
;
}
...
...
@@ -1192,7 +1194,7 @@ CCellCommentator.prototype.removeComment = function(id, bNoEvent, bNoAscLock, bN
CCellCommentator
.
prototype
.
getRangeComments
=
function
(
range
)
{
var
oComments
=
{};
if
(
this
.
model
.
workbook
.
handlers
.
trigger
(
'
hiddenComments
'
))
{
if
(
this
.
hiddenComments
(
))
{
return
null
;
}
...
...
@@ -1446,6 +1448,13 @@ CCellCommentator.prototype.Redo = function(type, data) {
}
};
CCellCommentator
.
prototype
.
hiddenComments
=
function
()
{
return
this
.
model
.
workbook
.
handlers
.
trigger
(
'
hiddenComments
'
);
};
CCellCommentator
.
prototype
.
showSolved
=
function
()
{
return
this
.
model
.
workbook
.
handlers
.
trigger
(
'
showSolved
'
);
};
//----------------------------------------------------------export----------------------------------------------------
var
prot
;
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
...
...
cell/view/WorkbookView.js
View file @
fb02de37
...
...
@@ -176,7 +176,8 @@
this
.
isCellEditMode
=
false
;
this
.
isShowComments
=
true
;
this
.
isShowComments
=
true
;
this
.
isShowSolved
=
true
;
this
.
formulasList
=
[];
// Список всех формул
this
.
lastFormulaPos
=
-
1
;
// Последняя позиция формулы
...
...
@@ -835,6 +836,9 @@
this
.
handlers
.
add
(
'
hiddenComments
'
,
function
()
{
return
!
self
.
isShowComments
;
});
this
.
handlers
.
add
(
'
showSolved
'
,
function
()
{
return
self
.
isShowSolved
;
});
this
.
model
.
handlers
.
add
(
"
hideSpecialPasteOptions
"
,
function
()
{
if
(
window
[
'
AscCommon
'
].
g_clipboardBase
.
showSpecialPasteButton
)
{
...
...
@@ -2572,12 +2576,13 @@
this
.
isDocumentPlaceChangedEnabled
=
val
;
};
WorkbookView
.
prototype
.
showComments
=
function
(
val
)
{
if
(
this
.
isShowComments
!==
val
)
{
this
.
isShowComments
=
val
;
this
.
drawWS
();
}
};
WorkbookView
.
prototype
.
showComments
=
function
(
val
,
isShowSolved
)
{
if
(
this
.
isShowComments
!==
val
||
this
.
isShowSolved
!==
isShowSolved
)
{
this
.
isShowComments
=
val
;
this
.
isShowSolved
=
isShowSolved
;
this
.
drawWS
();
}
};
/*
* @param {c_oAscRenderingModeType} mode Режим отрисовки
...
...
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