Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #8 from jeffposnick/master
Browse files Browse the repository at this point in the history
manual-change event
  • Loading branch information
frankiefu committed Jul 17, 2014
2 parents 5c3280a + 68ee517 commit 7cc6f1d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions paper-slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@
*
* @event change
*/

/**
* Fired when the slider's value changes due to manual interaction.
*
* Changes to the slider's value due to changes in an underlying
* bound variable will not trigger this event.
*
* @event manual-change
*/

/**
* If true, the slider thumb snaps to tick marks evenly spaced based
Expand Down Expand Up @@ -212,6 +221,7 @@

inputChange: function() {
this.value = this.$.input.value;
this.fire('manual-change');
},

calcKnobPosition: function() {
Expand Down Expand Up @@ -248,6 +258,7 @@
this.$.sliderKnob.classList.remove('dragging');
this.resetKnob();
this.value = this.immediateValue;
this.fire('manual-change');
},

bardown: function(e) {
Expand All @@ -257,6 +268,7 @@
this.positionKnob((e.x - rect.left) / this._w);
this.value = this.calcStep(this.calcKnobPosition());
this.expandJob = this.job(this.expandJob, this.expandKnob, 60);
this.fire('manual-change');
},

knobTransitionEnd: function() {
Expand Down Expand Up @@ -285,8 +297,10 @@
var c = e.keyCode;
if (c === 37) {
this.decrement();
this.fire('manual-change');
} else if (c === 39) {
this.increment();
this.fire('manual-change');
}
}

Expand Down

0 comments on commit 7cc6f1d

Please sign in to comment.