Mercurial > hg > webaudioevaluationtool
comparison interfaces/ape.js @ 3076:f565be5c8fc7
Pass handleEvent back to slider for metric imports
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Tue, 31 Oct 2017 22:29:18 +0000 |
parents | 0fc927572aab |
children | d70a2d48d635 |
comparison
equal
deleted
inserted
replaced
3075:0fc927572aab | 3076:f565be5c8fc7 |
---|---|
550 } | 550 } |
551 this.mousedown = function (sliderUI) { | 551 this.mousedown = function (sliderUI) { |
552 UI.selected = sliderUI; | 552 UI.selected = sliderUI; |
553 UI.startTime = new Date(); | 553 UI.startTime = new Date(); |
554 } | 554 } |
555 this.mouseup = function (sliderUI) { | 555 this.mouseup = function (event) { |
556 var delta = new Date() - UI.startTime; | 556 var delta = new Date() - UI.startTime; |
557 if (delta < 200) { | 557 if (delta < 200) { |
558 UI.selected.clicked(); | 558 UI.selected.clicked(); |
559 } else { | |
560 UI.handleEvent(event); | |
559 } | 561 } |
560 UI.selected = undefined; | 562 UI.selected = undefined; |
561 UI.startTime = undefined; | 563 UI.startTime = undefined; |
562 } | 564 } |
563 this.handleEvent = function (event) { | 565 this.handleEvent = function (event) { |
602 move = Math.min(w, move); | 604 move = Math.min(w, move); |
603 UI.selected.value = (move / w); | 605 UI.selected.value = (move / w); |
604 } | 606 } |
605 } else if (event.type == "touchend" || event.type == "touchcancel") { | 607 } else if (event.type == "touchend" || event.type == "touchcancel") { |
606 if (UI.selected == getTargetSlider(event.target)) { | 608 if (UI.selected == getTargetSlider(event.target)) { |
607 this.mouseup(UI.selected); | 609 this.mouseup(event); |
608 } | 610 } |
609 } | 611 } |
610 } | 612 } |
611 this.checkAllMoved = function () { | 613 this.checkAllMoved = function () { |
612 var notMoved = sliders.filter(function (s) { | 614 var notMoved = sliders.filter(function (s) { |