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
c50acf7a
Commit
c50acf7a
authored
Apr 06, 2017
by
Julia Radzhabova
Committed by
GitHub
Apr 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68 from ONLYOFFICE/feature/gradient-slider-change-markers
Feature/gradient slider change markers Fix Bug 34376
parents
4d842c19
4ffa3c5a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
126 additions
and
8 deletions
+126
-8
apps/common/main/lib/component/MultiSliderGradient.js
apps/common/main/lib/component/MultiSliderGradient.js
+12
-0
apps/common/main/lib/component/Slider.js
apps/common/main/lib/component/Slider.js
+30
-8
apps/documenteditor/main/app/view/ShapeSettings.js
apps/documenteditor/main/app/view/ShapeSettings.js
+12
-0
apps/documenteditor/main/app/view/TextArtSettings.js
apps/documenteditor/main/app/view/TextArtSettings.js
+12
-0
apps/presentationeditor/main/app/view/ShapeSettings.js
apps/presentationeditor/main/app/view/ShapeSettings.js
+12
-0
apps/presentationeditor/main/app/view/SlideSettings.js
apps/presentationeditor/main/app/view/SlideSettings.js
+12
-0
apps/presentationeditor/main/app/view/TextArtSettings.js
apps/presentationeditor/main/app/view/TextArtSettings.js
+12
-0
apps/spreadsheeteditor/main/app/view/ShapeSettings.js
apps/spreadsheeteditor/main/app/view/ShapeSettings.js
+12
-0
apps/spreadsheeteditor/main/app/view/TextArtSettings.js
apps/spreadsheeteditor/main/app/view/TextArtSettings.js
+12
-0
No files found.
apps/common/main/lib/component/MultiSliderGradient.js
View file @
c50acf7a
...
...
@@ -150,6 +150,18 @@ define([
}
style
=
Common
.
Utils
.
String
.
format
(
'
linear-gradient(to right, {0} {1}%, {2} {3}%)
'
,
this
.
colorValues
[
0
],
this
.
getValue
(
0
),
this
.
colorValues
[
1
],
this
.
getValue
(
1
));
this
.
trackEl
.
css
(
'
background
'
,
style
);
},
sortThumbs
:
function
()
{
var
recalc_indexes
=
Common
.
UI
.
MultiSlider
.
prototype
.
sortThumbs
.
call
(
this
),
new_colors
=
[],
me
=
this
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
)
{
new_colors
.
push
(
me
.
colorValues
[
recalc_index
]);
});
this
.
colorValues
=
new_colors
;
this
.
trigger
(
'
sortthumbs
'
,
me
,
recalc_indexes
);
return
recalc_indexes
;
}
});
});
apps/common/main/lib/component/Slider.js
View file @
c50acf7a
...
...
@@ -338,16 +338,21 @@ define([
e
.
preventDefault
();
e
.
stopPropagation
();
var
index
=
e
.
data
,
var
index
=
e
.
data
.
index
,
lastValue
=
me
.
thumbs
[
index
].
value
,
minValue
=
(
index
-
1
<
0
)
?
0
:
me
.
thumbs
[
index
-
1
].
position
,
maxValue
=
(
index
+
1
<
me
.
thumbs
.
length
)
?
me
.
thumbs
[
index
+
1
].
position
:
100
,
pos
=
Math
.
max
(
minValue
,
Math
.
min
(
maxValue
,
(
Math
.
round
((
e
.
pageX
*
Common
.
Utils
.
zoom
()
-
me
.
cmpEl
.
offset
().
left
-
me
.
_dragstart
)
/
me
.
width
*
100
)))),
position
=
Math
.
round
((
e
.
pageX
*
Common
.
Utils
.
zoom
()
-
me
.
cmpEl
.
offset
().
left
-
me
.
_dragstart
)
/
me
.
width
*
100
),
need_sort
=
position
<
minValue
||
position
>
maxValue
,
pos
=
Math
.
max
(
0
,
Math
.
min
(
100
,
position
)),
value
=
pos
/
me
.
delta
+
me
.
minValue
;
me
.
setThumbPosition
(
index
,
pos
);
me
.
thumbs
[
index
].
value
=
value
;
if
(
need_sort
)
me
.
sortThumbs
();
$
(
document
).
off
(
'
mouseup
'
,
onMouseUp
);
$
(
document
).
off
(
'
mousemove
'
,
onMouseMove
);
...
...
@@ -362,16 +367,21 @@ define([
e
.
preventDefault
();
e
.
stopPropagation
();
var
index
=
e
.
data
,
var
index
=
e
.
data
.
index
,
lastValue
=
me
.
thumbs
[
index
].
value
,
minValue
=
(
index
-
1
<
0
)
?
0
:
me
.
thumbs
[
index
-
1
].
position
,
maxValue
=
(
index
+
1
<
me
.
thumbs
.
length
)
?
me
.
thumbs
[
index
+
1
].
position
:
100
,
pos
=
Math
.
max
(
minValue
,
Math
.
min
(
maxValue
,
(
Math
.
round
((
e
.
pageX
*
Common
.
Utils
.
zoom
()
-
me
.
cmpEl
.
offset
().
left
-
me
.
_dragstart
)
/
me
.
width
*
100
)))),
position
=
Math
.
round
((
e
.
pageX
*
Common
.
Utils
.
zoom
()
-
me
.
cmpEl
.
offset
().
left
-
me
.
_dragstart
)
/
me
.
width
*
100
),
need_sort
=
position
<
minValue
||
position
>
maxValue
,
pos
=
Math
.
max
(
0
,
Math
.
min
(
100
,
position
)),
value
=
pos
/
me
.
delta
+
me
.
minValue
;
me
.
setThumbPosition
(
index
,
pos
);
me
.
thumbs
[
index
].
value
=
value
;
if
(
need_sort
)
me
.
sortThumbs
();
if
(
Math
.
abs
(
value
-
lastValue
)
>
0.001
)
me
.
trigger
(
'
change
'
,
me
,
value
,
lastValue
);
};
...
...
@@ -379,7 +389,7 @@ define([
var
onMouseDown
=
function
(
e
)
{
if
(
me
.
disabled
)
return
;
var
index
=
e
.
data
,
var
index
=
e
.
data
.
index
,
thumb
=
me
.
thumbs
[
index
].
thumb
;
me
.
_dragstart
=
e
.
pageX
*
Common
.
Utils
.
zoom
()
-
thumb
.
offset
().
left
-
thumb
.
width
()
/
2
;
...
...
@@ -389,8 +399,8 @@ define([
(
index
==
idx
)
?
item
.
thumb
.
css
(
'
z-index
'
,
500
)
:
item
.
thumb
.
css
(
'
z-index
'
,
''
);
});
$
(
document
).
on
(
'
mouseup
'
,
null
,
index
,
onMouseUp
);
$
(
document
).
on
(
'
mousemove
'
,
null
,
index
,
onMouseMove
);
$
(
document
).
on
(
'
mouseup
'
,
null
,
e
.
data
,
onMouseUp
);
$
(
document
).
on
(
'
mousemove
'
,
null
,
e
.
data
,
onMouseMove
);
};
var
onTrackMouseDown
=
function
(
e
)
{
...
...
@@ -441,7 +451,7 @@ define([
index
:
index
});
me
.
setValue
(
index
,
me
.
options
.
values
[
index
]);
thumb
.
on
(
'
mousedown
'
,
null
,
index
,
onMouseDown
);
thumb
.
on
(
'
mousedown
'
,
null
,
me
.
thumbs
[
index
]
,
onMouseDown
);
});
me
.
setActiveThumb
(
0
,
true
);
...
...
@@ -489,6 +499,18 @@ define([
if
(
disabled
!==
this
.
disabled
)
this
.
cmpEl
.
toggleClass
(
'
disabled
'
,
disabled
);
this
.
disabled
=
disabled
;
},
sortThumbs
:
function
()
{
this
.
thumbs
.
sort
(
function
(
a
,
b
)
{
return
(
a
.
position
-
b
.
position
);
});
var
recalc_indexes
=
[];
_
.
each
(
this
.
thumbs
,
function
(
thumb
,
index
)
{
recalc_indexes
.
push
(
thumb
.
index
);
thumb
.
index
=
index
;
});
return
recalc_indexes
;
}
});
});
apps/documenteditor/main/app/view/ShapeSettings.js
View file @
c50acf7a
...
...
@@ -1341,6 +1341,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
fillControls
.
push
(
this
.
sldrGradient
);
this
.
cmbBorderSize
=
new
Common
.
UI
.
ComboBorderSizeEditable
({
...
...
apps/documenteditor/main/app/view/TextArtSettings.js
View file @
c50acf7a
...
...
@@ -916,6 +916,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
lockedControls
.
push
(
this
.
sldrGradient
);
this
.
cmbBorderSize
=
new
Common
.
UI
.
ComboBorderSizeEditable
({
...
...
apps/presentationeditor/main/app/view/ShapeSettings.js
View file @
c50acf7a
...
...
@@ -1234,6 +1234,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
fillControls
.
push
(
this
.
sldrGradient
);
this
.
cmbBorderSize
=
new
Common
.
UI
.
ComboBorderSizeEditable
({
...
...
apps/presentationeditor/main/app/view/SlideSettings.js
View file @
c50acf7a
...
...
@@ -755,6 +755,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
FillItems
.
push
(
this
.
sldrGradient
);
},
...
...
apps/presentationeditor/main/app/view/TextArtSettings.js
View file @
c50acf7a
...
...
@@ -1224,6 +1224,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
lockedControls
.
push
(
this
.
sldrGradient
);
this
.
cmbBorderSize
=
new
Common
.
UI
.
ComboBorderSizeEditable
({
...
...
apps/spreadsheeteditor/main/app/view/ShapeSettings.js
View file @
c50acf7a
...
...
@@ -1258,6 +1258,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
fillControls
.
push
(
this
.
sldrGradient
);
this
.
cmbBorderSize
=
new
Common
.
UI
.
ComboBorderSizeEditable
({
...
...
apps/spreadsheeteditor/main/app/view/TextArtSettings.js
View file @
c50acf7a
...
...
@@ -1228,6 +1228,18 @@ define([
this
.
sldrGradient
.
on
(
'
thumbdblclick
'
,
function
(
cmp
){
me
.
btnGradColor
.
cmpEl
.
find
(
'
button
'
).
dropdown
(
'
toggle
'
);
});
this
.
sldrGradient
.
on
(
'
sortthumbs
'
,
function
(
cmp
,
recalc_indexes
){
var
colors
=
[],
currentIdx
;
_
.
each
(
recalc_indexes
,
function
(
recalc_index
,
index
)
{
colors
.
push
(
me
.
GradColor
.
colors
[
recalc_index
]);
if
(
me
.
GradColor
.
currentIdx
==
recalc_index
)
currentIdx
=
index
;
});
me
.
OriginalFillType
=
null
;
me
.
GradColor
.
colors
=
colors
;
me
.
GradColor
.
currentIdx
=
currentIdx
;
});
this
.
lockedControls
.
push
(
this
.
sldrGradient
);
this
.
cmbBorderSize
=
new
Common
.
UI
.
ComboBorderSizeEditable
({
...
...
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