Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
14c2a177
Commit
14c2a177
authored
Dec 28, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] Disable inserting sparklines when objects are selected (shape, image, chart).
parent
1ed82bd3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
+29
-5
apps/common/main/lib/component/DataView.js
apps/common/main/lib/component/DataView.js
+7
-1
apps/common/main/resources/less/dataview.less
apps/common/main/resources/less/dataview.less
+10
-3
apps/spreadsheeteditor/main/app/controller/Toolbar.js
apps/spreadsheeteditor/main/app/controller/Toolbar.js
+12
-1
No files found.
apps/common/main/lib/component/DataView.js
View file @
14c2a177
...
@@ -101,7 +101,8 @@ define([
...
@@ -101,7 +101,8 @@ define([
id
:
Common
.
UI
.
getId
(),
id
:
Common
.
UI
.
getId
(),
selected
:
false
,
selected
:
false
,
allowSelected
:
true
,
allowSelected
:
true
,
value
:
null
value
:
null
,
disabled
:
false
}
}
}
}
});
});
...
@@ -142,6 +143,7 @@ define([
...
@@ -142,6 +143,7 @@ define([
el
.
off
(
'
click
'
).
on
(
'
click
'
,
_
.
bind
(
this
.
onClick
,
this
));
el
.
off
(
'
click
'
).
on
(
'
click
'
,
_
.
bind
(
this
.
onClick
,
this
));
el
.
off
(
'
dblclick
'
).
on
(
'
dblclick
'
,
_
.
bind
(
this
.
onDblClick
,
this
));
el
.
off
(
'
dblclick
'
).
on
(
'
dblclick
'
,
_
.
bind
(
this
.
onDblClick
,
this
));
el
.
off
(
'
contextmenu
'
).
on
(
'
contextmenu
'
,
_
.
bind
(
this
.
onContextMenu
,
this
));
el
.
off
(
'
contextmenu
'
).
on
(
'
contextmenu
'
,
_
.
bind
(
this
.
onContextMenu
,
this
));
el
.
toggleClass
(
'
disabled
'
,
this
.
model
.
get
(
'
disabled
'
));
if
(
!
_
.
isUndefined
(
this
.
model
.
get
(
'
cls
'
)))
if
(
!
_
.
isUndefined
(
this
.
model
.
get
(
'
cls
'
)))
el
.
addClass
(
this
.
model
.
get
(
'
cls
'
));
el
.
addClass
(
this
.
model
.
get
(
'
cls
'
));
...
@@ -159,10 +161,14 @@ define([
...
@@ -159,10 +161,14 @@ define([
},
},
onClick
:
function
(
e
)
{
onClick
:
function
(
e
)
{
if
(
this
.
model
.
get
(
'
disabled
'
))
return
false
;
this
.
trigger
(
'
click
'
,
this
,
this
.
model
,
e
);
this
.
trigger
(
'
click
'
,
this
,
this
.
model
,
e
);
},
},
onDblClick
:
function
(
e
)
{
onDblClick
:
function
(
e
)
{
if
(
this
.
model
.
get
(
'
disabled
'
))
return
false
;
this
.
trigger
(
'
dblclick
'
,
this
,
this
.
model
,
e
);
this
.
trigger
(
'
dblclick
'
,
this
,
this
.
model
,
e
);
},
},
...
...
apps/common/main/resources/less/dataview.less
View file @
14c2a177
...
@@ -46,12 +46,19 @@
...
@@ -46,12 +46,19 @@
display: inline-block;
display: inline-block;
float: left;
float: left;
margin: 2px 4px 4px;
margin: 2px 4px 4px;
cursor: pointer;
&:not(.disabled) {
cursor: pointer;
}
&.disabled {
opacity: 0.5;
}
.box-shadow(0 0 0 1px @gray);
.box-shadow(0 0 0 1px @gray);
&:hover,
&:hover
:not(.disabled)
,
&.selected {
&.selected
:not(.disabled)
{
.box-shadow(0 0 0 2px @primary);
.box-shadow(0 0 0 2px @primary);
}
}
}
}
...
...
apps/spreadsheeteditor/main/app/controller/Toolbar.js
View file @
14c2a177
...
@@ -100,7 +100,8 @@ define([
...
@@ -100,7 +100,8 @@ define([
tablename
:
undefined
,
tablename
:
undefined
,
namedrange_locked
:
false
,
namedrange_locked
:
false
,
fontsize
:
undefined
,
fontsize
:
undefined
,
multiselect
:
false
multiselect
:
false
,
sparklines_disabled
:
false
};
};
var
checkInsertAutoshape
=
function
(
e
,
action
)
{
var
checkInsertAutoshape
=
function
(
e
,
action
)
{
...
@@ -1625,6 +1626,16 @@ define([
...
@@ -1625,6 +1626,16 @@ define([
toolbar
.
lockToolbar
(
SSE
.
enumLock
.
cantHyperlink
,
(
selectionType
==
Asc
.
c_oAscSelectionType
.
RangeShapeText
)
&&
(
this
.
api
.
asc_canAddShapeHyperlink
()
===
false
),
{
array
:
[
toolbar
.
btnInsertHyperlink
]});
toolbar
.
lockToolbar
(
SSE
.
enumLock
.
cantHyperlink
,
(
selectionType
==
Asc
.
c_oAscSelectionType
.
RangeShapeText
)
&&
(
this
.
api
.
asc_canAddShapeHyperlink
()
===
false
),
{
array
:
[
toolbar
.
btnInsertHyperlink
]});
need_disable
=
selectionType
!=
Asc
.
c_oAscSelectionType
.
RangeCells
&&
selectionType
!=
Asc
.
c_oAscSelectionType
.
RangeCol
&&
selectionType
!=
Asc
.
c_oAscSelectionType
.
RangeRow
&&
selectionType
!=
Asc
.
c_oAscSelectionType
.
RangeMax
;
if
(
this
.
_state
.
sparklines_disabled
!==
need_disable
)
{
var
len
=
toolbar
.
mnuInsertChartPicker
.
store
.
length
;
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
toolbar
.
mnuInsertChartPicker
.
store
.
at
(
len
-
i
-
1
).
set
({
disabled
:
need_disable
});
this
.
_state
.
sparklines_disabled
=
need_disable
;
}
}
if
(
editOptionsDisabled
)
return
;
if
(
editOptionsDisabled
)
return
;
/* read font params */
/* read font params */
...
...
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