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