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

manual-change event #8

Merged
merged 3 commits into from
Jul 17, 2014
Merged

manual-change event #8

merged 3 commits into from
Jul 17, 2014

Conversation

jeffposnick
Copy link
Contributor

Added JSDoc for the manual-change event and fire it in the code when
value changes due to manual interaction.

See #7 for context.

Added JSDoc for the `manual-change` event and fire it in the code when
`value` changes due to manual interaction.
@@ -271,10 +283,12 @@

increment: function() {
this.value = this.clampValue(this.value + this.step);
this.fire('manual-change');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is better to move this to keydown() so if someone invokes increment()/decrement() manually the event will not be fired.

…instead of in increment/decrement.
@@ -287,6 +299,7 @@
} else if (c === 39) {
this.increment();
}
this.fire('manual-change');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not being clear previously, but It should fire only when increment/decrement is called. e.g.

if (c === 37) {
  this.decrement();
  this.fire('manual-change');
} else if (c === 39) {
  this.increment();
  this.fire('manual-change');
}

@frankiefu
Copy link
Contributor

lgtm

frankiefu added a commit that referenced this pull request Jul 17, 2014
@frankiefu frankiefu merged commit 7cc6f1d into googlearchive:master Jul 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants