Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
b2e3799c
Commit
b2e3799c
authored
Sep 14, 2016
by
yann300
Committed by
GitHub
Sep 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #108 from ethereum/smoothslider
Trigger slider events while moving.
parents
8b8cacdf
333e3825
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Slider.js
src/ui/Slider.js
+8
-4
No files found.
src/ui/Slider.js
View file @
b2e3799c
...
@@ -11,6 +11,8 @@ function Slider (_traceManager) {
...
@@ -11,6 +11,8 @@ function Slider (_traceManager) {
this
.
max
this
.
max
this
.
disabled
=
true
this
.
disabled
=
true
this
.
view
this
.
view
this
.
previousValue
=
null
}
}
Slider
.
prototype
.
render
=
function
()
{
Slider
.
prototype
.
render
=
function
()
{
...
@@ -23,8 +25,8 @@ Slider.prototype.render = function () {
...
@@ -23,8 +25,8 @@ Slider.prototype.render = function () {
min=0
min=0
max=
${
this
.
max
}
max=
${
this
.
max
}
value=0
value=0
on
keyup
=
${
function
()
{
self
.
onChange
()
}
}
on
change
=
${
function
()
{
self
.
onChange
()
}
}
on
mouseup
=
${
function
()
{
self
.
onChange
()
}
}
on
input
=
${
function
()
{
self
.
onChange
()
}
}
disabled=
${
this
.
disabled
}
/>
disabled=
${
this
.
disabled
}
/>
</div>`
</div>`
if
(
!
this
.
view
)
{
if
(
!
this
.
view
)
{
...
@@ -43,8 +45,10 @@ Slider.prototype.init = function (length) {
...
@@ -43,8 +45,10 @@ Slider.prototype.init = function (length) {
}
}
Slider
.
prototype
.
onChange
=
function
(
event
)
{
Slider
.
prototype
.
onChange
=
function
(
event
)
{
var
value
=
document
.
getElementById
(
'slider'
).
value
var
value
=
parseInt
(
document
.
getElementById
(
'slider'
).
value
)
this
.
trigger
(
'moved'
,
[
parseInt
(
value
)])
if
(
value
===
this
.
previousValue
)
return
this
.
previousValue
=
value
this
.
trigger
(
'moved'
,
[
value
])
}
}
Slider
.
prototype
.
setValue
=
function
(
value
)
{
Slider
.
prototype
.
setValue
=
function
(
value
)
{
...
...
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