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
7051b0f0
Commit
7051b0f0
authored
Oct 06, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix draw selection for dialogs
parent
ade2bb12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
25 deletions
+36
-25
cell/utils/utils.js
cell/utils/utils.js
+5
-0
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+31
-25
No files found.
cell/utils/utils.js
View file @
7051b0f0
...
...
@@ -601,6 +601,11 @@
this
.
activeCellId
=
-
1
;
this
.
activeCell
.
clean
();
};
SelectionRange
.
prototype
.
assign2
=
function
(
range
)
{
this
.
clean
();
this
.
getLast
().
assign2
(
range
);
this
.
update
();
};
SelectionRange
.
prototype
.
offsetCell
=
function
(
dr
,
dc
,
fCheckSize
)
{
var
done
,
curRange
,
mc
;
var
lastRow
=
this
.
activeCell
.
row
;
...
...
cell/view/WorksheetView.js
View file @
7051b0f0
...
...
@@ -3638,7 +3638,7 @@
// draw active cell in selection
var
isActive
=
AscCommonExcel
.
selectionLineType
.
ActiveCell
&
selectionLineType
;
if
(
isActive
)
{
var
cell
=
this
.
model
.
selectionRange
.
activeCell
;
var
cell
=
(
this
.
isSelectionDialogMode
?
this
.
copyActiveRange
:
this
.
model
.
selectionRange
)
.
activeCell
;
var
fs
=
this
.
model
.
getMergedByCell
(
cell
.
row
,
cell
.
col
);
fs
=
range
.
intersectionSimple
(
fs
?
fs
:
new
asc_Range
(
cell
.
col
,
cell
.
row
,
cell
.
col
,
cell
.
row
));
...
...
@@ -3753,7 +3753,7 @@
var
isOtherSelectionMode
=
this
.
isSelectionDialogMode
||
this
.
isFormulaEditMode
;
if
(
isOtherSelectionMode
&&
!
this
.
handlers
.
trigger
(
'
isActive
'
))
{
if
(
this
.
isSelectionDialogMode
)
{
this
.
_drawSelectRange
(
this
.
activeRange
.
clone
(
true
)
);
this
.
_drawSelectRange
();
}
else
if
(
this
.
isFormulaEditMode
)
{
this
.
_drawFormulaRanges
(
this
.
arrActiveFormulaRanges
);
}
...
...
@@ -3777,7 +3777,7 @@
this
.
_drawFormulaRanges
(
this
.
arrActiveChartsRanges
);
}
if
(
this
.
isSelectionDialogMode
)
{
this
.
_drawSelectRange
(
this
.
activeRange
.
clone
(
true
)
);
this
.
_drawSelectRange
();
}
if
(
this
.
stateFormatPainter
&&
this
.
handlers
.
trigger
(
'
isActive
'
))
{
this
.
_drawFormatPainterRange
();
...
...
@@ -3798,9 +3798,10 @@
};
WorksheetView
.
prototype
.
_drawSelectionRange
=
function
()
{
var
ranges
=
(
this
.
isSelectionDialogMode
?
this
.
copyActiveRange
:
this
.
model
.
selectionRange
).
ranges
;
var
range
,
selectionLineType
;
for
(
var
i
=
0
,
l
=
this
.
model
.
selectionRange
.
ranges
.
length
;
i
<
l
;
++
i
)
{
range
=
this
.
model
.
selectionRange
.
ranges
[
i
];
for
(
var
i
=
0
,
l
=
ranges
.
length
;
i
<
l
;
++
i
)
{
range
=
ranges
[
i
];
if
(
c_oAscSelectionType
.
RangeMax
===
range
.
type
)
{
range
.
c2
=
this
.
cols
.
length
-
1
;
range
.
r2
=
this
.
rows
.
length
-
1
;
...
...
@@ -3845,9 +3846,12 @@
}
};
WorksheetView
.
prototype
.
_drawSelectRange
=
function
(
oSelectRange
)
{
this
.
_drawElements
(
this
.
_drawSelectionElement
,
oSelectRange
,
AscCommonExcel
.
selectionLineType
.
Dash
,
AscCommonExcel
.
c_oAscCoAuthoringOtherBorderColor
);
WorksheetView
.
prototype
.
_drawSelectRange
=
function
()
{
var
ranges
=
this
.
model
.
selectionRange
.
ranges
;
for
(
var
i
=
0
,
l
=
ranges
.
length
;
i
<
l
;
++
i
)
{
this
.
_drawElements
(
this
.
_drawSelectionElement
,
ranges
[
i
],
AscCommonExcel
.
selectionLineType
.
Dash
,
AscCommonExcel
.
c_oAscCoAuthoringOtherBorderColor
);
}
};
WorksheetView
.
prototype
.
_drawCollaborativeElements
=
function
()
{
...
...
@@ -4119,19 +4123,22 @@
}
if
(
null
!==
this
.
copyActiveRange
)
{
// Координаты для перемещения диапазона
_x1
=
this
.
cols
[
this
.
copyActiveRange
.
c1
].
left
-
offsetX
-
this
.
width_2px
;
_x2
=
this
.
cols
[
this
.
copyActiveRange
.
c2
].
left
+
this
.
cols
[
this
.
copyActiveRange
.
c2
].
width
-
offsetX
+
this
.
width_1px
+
this
.
width_2px
;
_y1
=
this
.
rows
[
this
.
copyActiveRange
.
r1
].
top
-
offsetY
-
this
.
height_2px
;
_y2
=
this
.
rows
[
this
.
copyActiveRange
.
r2
].
top
+
this
.
rows
[
this
.
copyActiveRange
.
r2
].
height
-
offsetY
+
this
.
height_1px
+
this
.
height_2px
;
// Выбираем наибольший range для очистки
x1
=
Math
.
min
(
x1
,
_x1
);
x2
=
Math
.
max
(
x2
,
_x2
);
y1
=
Math
.
min
(
y1
,
_y1
);
y2
=
Math
.
max
(
y2
,
_y2
);
this
.
copyActiveRange
.
ranges
.
forEach
(
function
(
item
)
{
var
arnIntersection
=
item
.
intersectionSimple
(
range
);
if
(
arnIntersection
)
{
_x1
=
t
.
cols
[
arnIntersection
.
c1
].
left
-
offsetX
-
t
.
width_2px
;
_x2
=
t
.
cols
[
arnIntersection
.
c2
].
left
+
t
.
cols
[
arnIntersection
.
c2
].
width
-
offsetX
+
t
.
width_1px
+
/* Это ширина "квадрата" для автофильтра от границы ячейки */
t
.
width_2px
;
_y1
=
t
.
rows
[
arnIntersection
.
r1
].
top
-
offsetY
-
t
.
height_2px
;
_y2
=
t
.
rows
[
arnIntersection
.
r2
].
top
+
t
.
rows
[
arnIntersection
.
r2
].
height
-
offsetY
+
t
.
height_1px
+
/* Это высота "квадрата" для автофильтра от границы ячейки */
t
.
height_2px
;
x1
=
Math
.
min
(
x1
,
_x1
);
x2
=
Math
.
max
(
x2
,
_x2
);
y1
=
Math
.
min
(
y1
,
_y1
);
y2
=
Math
.
max
(
y2
,
_y2
);
}
});
}
if
(
!
(
Number
.
MAX_VALUE
===
x1
&&
-
Number
.
MAX_VALUE
===
x2
&&
Number
.
MAX_VALUE
===
y1
&&
...
...
@@ -10986,15 +10993,14 @@
if
(
false
===
this
.
isSelectionDialogMode
)
{
if
(
null
!==
this
.
copyActiveRange
)
{
this
.
activeRange
=
this
.
copyActiveRange
.
clone
(
true
);
this
.
model
.
selectionRange
=
this
.
copyActiveRange
.
clone
(
);
}
this
.
copyActiveRange
=
null
;
if
(
oldSelectionDialogType
===
c_oAscSelectionDialogType
.
Chart
)
{
this
.
objectRender
.
controller
.
checkChartForProps
(
false
);
}
}
else
{
this
.
copyActiveRange
=
this
.
activeRange
.
clone
(
true
);
this
.
copyActiveRange
=
this
.
model
.
selectionRange
.
clone
();
if
(
selectRange
)
{
if
(
typeof
selectRange
===
'
string
'
)
{
selectRange
=
this
.
model
.
getRange2
(
selectRange
);
...
...
@@ -11004,7 +11010,7 @@
}
if
(
null
!=
selectRange
)
{
this
.
activeRange
.
assign
(
selectRange
.
c1
,
selectRange
.
r1
,
selectRange
.
c2
,
selectRange
.
r2
);
this
.
model
.
selectionRange
.
assign2
(
selectRange
);
}
}
if
(
selectionDialogType
===
c_oAscSelectionDialogType
.
Chart
)
{
...
...
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