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
Hide 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 @@
...
@@ -251,6 +251,9 @@
this
.
specialPasteStart
=
false
;
this
.
specialPasteStart
=
false
;
this
.
bIsEndTransaction
=
false
;
//если нужно сделать на end_paste endTransaction
this
.
bIsEndTransaction
=
false
;
//если нужно сделать на end_paste endTransaction
this
.
showSpecialPasteButton
=
false
;
//нужно показывать или нет кнопку специальной вставки
this
.
specialPasteRange
=
null
;
//для того, чтобы показать в нужном месте иконку(кнопку) специальной вставки
return
this
;
return
this
;
}
}
...
@@ -446,6 +449,44 @@
...
@@ -446,6 +449,44 @@
this
.
specialPasteStart
=
true
;
this
.
specialPasteStart
=
true
;
//console.log("specialPasteStart: " + this.specialPasteStart);
//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 @@
...
@@ -711,7 +711,10 @@
},
},
"
showSpecialPasteOptions
"
:
function
(
val
)
{
"
showSpecialPasteOptions
"
:
function
(
val
)
{
self
.
handlers
.
trigger
(
"
asc_onShowSpecialPasteOptions
"
,
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 @@
...
@@ -826,8 +829,11 @@
return
!
self
.
isShowComments
;
return
!
self
.
isShowComments
;
});
});
this
.
model
.
handlers
.
add
(
"
hideSpecialPasteOptions
"
,
function
()
{
this
.
model
.
handlers
.
add
(
"
hideSpecialPasteOptions
"
,
function
()
{
self
.
handlers
.
trigger
(
"
asc_onHideSpecialPasteOptions
"
);
if
(
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
showSpecialPasteButton
)
//console.log("hideSpecialPasteOptions");
{
self
.
handlers
.
trigger
(
"
asc_onHideSpecialPasteOptions
"
);
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
showSpecialPasteButton
=
false
;
}
});
});
this
.
cellCommentator
=
new
AscCommonExcel
.
CCellCommentator
({
this
.
cellCommentator
=
new
AscCommonExcel
.
CCellCommentator
({
...
...
cell/view/WorksheetView.js
View file @
e71fe0bd
...
@@ -5605,6 +5605,7 @@
...
@@ -5605,6 +5605,7 @@
//ToDo this.drawDepCells();
//ToDo this.drawDepCells();
this
.
cellCommentator
.
updateCommentPosition
();
this
.
cellCommentator
.
updateCommentPosition
();
this
.
cellCommentator
.
drawCommentCells
();
this
.
cellCommentator
.
drawCommentCells
();
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
updateSpecialPasteOptionsPosition
(
this
);
return
this
;
return
this
;
};
};
...
@@ -8974,7 +8975,7 @@
...
@@ -8974,7 +8975,7 @@
//for special paste
//for special paste
if
(
!
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteStart
)
if
(
!
window
[
"
Asc
"
][
"
editor
"
].
wb
.
clipboard
.
specialPasteStart
)
{
{
var
specialPasteShowOptions
=
new
Asc
.
SpecialPasteShowOptions
();
//
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
var
allowedSpecialPasteProps
;
var
allowedSpecialPasteProps
;
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
if
(
fromBinary
)
if
(
fromBinary
)
...
@@ -8986,11 +8987,7 @@
...
@@ -8986,11 +8987,7 @@
//matchDestinationFormatting - пока не добавляю, так как работает как и values
//matchDestinationFormatting - пока не добавляю, так как работает как и values
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
}
}
_clipboard
.
showSpecialPasteOptions
(
this
,
allowedSpecialPasteProps
,
selectData
[
0
]);
specialPasteShowOptions
.
asc_setOptions
(
allowedSpecialPasteProps
);
var
cellCoord
=
this
.
getCellCoord
(
selectData
[
0
].
c2
,
selectData
[
0
].
r2
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
}
}
};
};
...
@@ -9114,7 +9111,7 @@
...
@@ -9114,7 +9111,7 @@
var
rangeUnMerge
=
t
.
model
.
getRange3
(
arn
.
r1
,
arn
.
c1
,
rMax
-
1
,
cMax
-
1
);
var
rangeUnMerge
=
t
.
model
.
getRange3
(
arn
.
r1
,
arn
.
c1
,
rMax
-
1
,
cMax
-
1
);
var
isOneMerge
=
false
;
var
isOneMerge
=
false
;
//если вставляем в мерженную ячейку, диапазон которой больше или равен
//если вставляем в мерженную ячейку, диапазон которой больше или равен
var
fPasteCell
=
pasteContent
.
content
[
0
][
0
];
var
fPasteCell
=
pasteContent
.
content
[
0
][
0
];
if
(
arn
.
c2
>=
cMax
-
1
&&
arn
.
r2
>=
rMax
-
1
&&
isMergedFirstCell
&&
isMergedFirstCell
.
isEqual
(
arn
)
&&
cMax
-
arn
.
c1
===
fPasteCell
.
colSpan
&&
rMax
-
arn
.
r1
===
fPasteCell
.
rowSpan
)
{
if
(
arn
.
c2
>=
cMax
-
1
&&
arn
.
r2
>=
rMax
-
1
&&
isMergedFirstCell
&&
isMergedFirstCell
.
isEqual
(
arn
)
&&
cMax
-
arn
.
c1
===
fPasteCell
.
colSpan
&&
rMax
-
arn
.
r1
===
fPasteCell
.
rowSpan
)
{
if
(
!
isCheckSelection
)
{
if
(
!
isCheckSelection
)
{
...
@@ -9122,7 +9119,7 @@
...
@@ -9122,7 +9119,7 @@
pasteContent
.
content
[
0
][
0
].
rowSpan
=
isMergedFirstCell
.
r2
-
isMergedFirstCell
.
r1
+
1
;
pasteContent
.
content
[
0
][
0
].
rowSpan
=
isMergedFirstCell
.
r2
-
isMergedFirstCell
.
r1
+
1
;
}
}
isOneMerge
=
true
;
isOneMerge
=
true
;
}
}
else
{
else
{
//проверка на наличие части объединённой ячейки в области куда осуществляем вставку
//проверка на наличие части объединённой ячейки в области куда осуществляем вставку
for
(
var
rFirst
=
arn
.
r1
;
rFirst
<
rMax
;
++
rFirst
)
{
for
(
var
rFirst
=
arn
.
r1
;
rFirst
<
rMax
;
++
rFirst
)
{
...
@@ -9585,7 +9582,7 @@
...
@@ -9585,7 +9582,7 @@
arrFormula
=
formulaProps
.
arrFormula
;
arrFormula
=
formulaProps
.
arrFormula
;
tablesMap
=
formulaProps
.
tablesMap
;
tablesMap
=
formulaProps
.
tablesMap
;
newVal
=
formulaProps
.
newVal
;
newVal
=
formulaProps
.
newVal
;
isOneMerge
=
formulaProps
.
isOneMerge
;
isOneMerge
=
formulaProps
.
isOneMerge
;
val
=
formulaProps
.
val
;
val
=
formulaProps
.
val
;
}
}
...
...
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