Browse files

quick and dirty scrollwheel fallback on contacts list for browser users

  • Loading branch information...
1 parent b20323a commit ff486899c97f51d0e63b53a2be682bc3123ae994 @deanlandolt committed Mar 4, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 apps/dialer/js/contacts.js
View
15 apps/dialer/js/contacts.js
@@ -480,5 +480,18 @@ window.addEventListener('load', function contactSetup(evt) {
document.getElementById('contact-details-container').addEventListener('click', function(evt) {
evt.stopPropagation();
});
-
+
+ // add scrollwheel fallback for browser users
+ var scrollNode = Contacts.view;
+ scrollNode.addEventListener('DOMMouseScroll', wheel, false);
+
+ function wheel(evt){
+ var s;
+ if (!evt) {
+ s = -window.event.wheelDelta;
+ } else {
+ s = evt.detail;
+ }
+ scrollNode.scrollTop += 10 * ((s > 0) ? 1 : -1);
+ }
});

2 comments on commit ff48689

@etiennesegonzac

I'm not sure about this...

@vingtetun what's your take on browser-specific fallback like this?

@deanlandolt
Owner

yeah, this is pretty awful, i was just frustrated by broken scrolling...i suspect i can find a way to hide the native scrollbar but still allow the scrollwheel, but google had come up blank

that said, i'm curious what @vingtetun says about browser-specific fallbacks -- i don't see why this can't work nicely on ff...i could even envision a plugin that implements mozTelephony by way of skype, gtalk, or any other number of vendors. no sense in ruling it out, at least

Please sign in to comment.