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
e71fe0bd
Commit
e71fe0bd
authored
Feb 14, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functions for change special paste icon position
parent
8c2683f3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
12 deletions
+56
-12
cell/model/clipboard.js
cell/model/clipboard.js
+41
-0
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+9
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+6
-9
No files found.
cell/model/clipboard.js
View file @
e71fe0bd
...
...
@@ -251,6 +251,9 @@
this
.
specialPasteStart
=
false
;
this
.
bIsEndTransaction
=
false
;
//если нужно сделать на end_paste endTransaction
this
.
showSpecialPasteButton
=
false
;
//нужно показывать или нет кнопку специальной вставки
this
.
specialPasteRange
=
null
;
//для того, чтобы показать в нужном месте иконку(кнопку) специальной вставки
return
this
;
}
...
...
@@ -446,6 +449,44 @@
this
.
specialPasteStart
=
true
;
//console.log("specialPasteStart: " + this.specialPasteStart);
},
showSpecialPasteOptions
:
function
(
ws
,
props
,
range
)
{
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
this
.
specialPasteRange
=
range
;
var
isVisible
=
null
!==
ws
.
getCellVisibleRange
(
range
.
c2
,
range
.
r2
);
var
cellCoord
=
ws
.
getCellCoord
(
range
.
c2
,
range
.
r2
);
if
(
!
isVisible
)
{
cellCoord
.
_x
=
-
1
;
cellCoord
.
_y
=
-
1
;
}
specialPasteShowOptions
.
asc_setOptions
(
props
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
ws
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
},
updateSpecialPasteOptionsPosition
:
function
(
ws
)
{
if
(
this
.
showSpecialPasteButton
&&
this
.
specialPasteRange
)
{
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
var
range
=
this
.
specialPasteRange
;
var
isVisible
=
null
!==
ws
.
getCellVisibleRange
(
range
.
c2
,
range
.
r2
);
var
cellCoord
=
ws
.
getCellCoord
(
range
.
c2
,
range
.
r2
);
if
(
!
isVisible
)
{
cellCoord
.
_x
=
-
1
;
cellCoord
.
_y
=
-
1
;
}
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
ws
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
}
}
};
...
...
cell/view/WorkbookView.js
View file @
e71fe0bd
...
...
@@ -711,7 +711,10 @@
},
"
showSpecialPasteOptions
"
:
function
(
val
)
{
self
.
handlers
.
trigger
(
"
asc_onShowSpecialPasteOptions
"
,
val
);
//console.log("showSpecialPasteOptions");
if
(
!
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
showSpecialPasteButton
)
{
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
showSpecialPasteButton
=
true
;
}
}
});
...
...
@@ -826,8 +829,11 @@
return
!
self
.
isShowComments
;
});
this
.
model
.
handlers
.
add
(
"
hideSpecialPasteOptions
"
,
function
()
{
if
(
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
showSpecialPasteButton
)
{
self
.
handlers
.
trigger
(
"
asc_onHideSpecialPasteOptions
"
);
//console.log("hideSpecialPasteOptions");
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
showSpecialPasteButton
=
false
;
}
});
this
.
cellCommentator
=
new
AscCommonExcel
.
CCellCommentator
({
...
...
cell/view/WorksheetView.js
View file @
e71fe0bd
...
...
@@ -5605,6 +5605,7 @@
//ToDo this.drawDepCells();
this
.
cellCommentator
.
updateCommentPosition
();
this
.
cellCommentator
.
drawCommentCells
();
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
updateSpecialPasteOptionsPosition
(
this
);
return
this
;
};
...
...
@@ -8974,7 +8975,7 @@
//for special paste
if
(
!
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteStart
)
{
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
//
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
var
allowedSpecialPasteProps
;
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
if
(
fromBinary
)
...
...
@@ -8986,11 +8987,7 @@
//matchDestinationFormatting - пока не добавляю, так как работает как и values
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
}
specialPasteShowOptions
.
asc_setOptions
(
allowedSpecialPasteProps
);
var
cellCoord
=
this
.
getCellCoord
(
selectData
[
0
].
c2
,
selectData
[
0
].
r2
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
_clipboard
.
showSpecialPasteOptions
(
this
,
allowedSpecialPasteProps
,
selectData
[
0
]);
}
};
...
...
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