Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 917337 - [Clock] Implement Scrolling for Timer Settings
https://bugzilla.mozilla.org/show_bug.cgi?id=917337

- Adds overflow-y: auto to #timer-dialog
- Adds a event.preventDefault() on touchstart on the time picker to stop user from scrolling while spinning inputs

r=jugglinmike
  • Loading branch information
gnarf authored and jugglinmike committed Sep 18, 2013
1 parent c538b69 commit 909f188
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions apps/clock/js/picker/spinner.js
Expand Up @@ -57,7 +57,6 @@

this.timeout = null;

var handler = this.handleEvent.bind(this);
var length = this.values.length;
var html = '';
var speed = 0;
Expand All @@ -72,8 +71,9 @@

this.element.innerHTML = html;

this.element.addEventListener('pan', handler, false);
this.element.addEventListener('swipe', handler, false);
this.element.addEventListener('touchstart', this, false);
this.element.addEventListener('pan', this, false);
this.element.addEventListener('swipe', this, false);

Object.defineProperties(this, {
value: {
Expand Down Expand Up @@ -129,6 +129,13 @@
this['on' + event.type](event);
};

/**
* ontouchstart - prevent default action (stops scrolling)
*/
Spinner.prototype.ontouchstart = function(event) {
event.preventDefault();
};

Spinner.prototype.onpan = function(event) {
event.stopPropagation();
var position = event.detail.position;
Expand Down
1 change: 1 addition & 0 deletions apps/clock/style/timer.css
Expand Up @@ -27,6 +27,7 @@
#timer-dialog {
position: absolute;
width: 100%;
overflow-y: auto;
}

#timer-active {
Expand Down

0 comments on commit 909f188

Please sign in to comment.