Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Sep 28, 2015
1 parent d370294 commit 360168d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ TODO
* Add better promotional images on the Chrome Web Store
* Add in an option for reversing the X and Y axis (up is down, down is up, etc.)
* Add in touchscreen/tablet support
* When scrolling horizontally, it should only scroll when the mouse is to the left/right of the disc, like in Firefox
* When scrolling vertically, it should only scroll when the mouse is to the top/bottom of the disc, like in Firefox
20 changes: 8 additions & 12 deletions src/data/AutoScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ chrome.storage.local.get(defaults, function (options) {
oldX: null,
oldY: null,

dirX: null,
dirY: null,
dirX: 0,
dirY: 0,

click: false,
scrolling: false
Expand Down Expand Up @@ -244,15 +244,11 @@ chrome.storage.local.get(defaults, function (options) {
state.oldX = null
state.oldY = null

state.dirX = null
state.dirY = null
state.dirX = 0
state.dirY = 0

state.click = false
state.scrolling = false

// Force relayout
//getComputedStyle(root).left;
//getComputedStyle(inner).left;
}

function normalCursor() {
Expand Down Expand Up @@ -293,7 +289,7 @@ chrome.storage.local.get(defaults, function (options) {
elem.type === "submit")
} else {
while (true) {
if (elem === document.body || elem === htmlNode) {
if (elem === document || elem === document.body || elem === htmlNode) {
return false
} else if (elem.localName === "a" && elem.href || elem.localName === "textarea") {
return true
Expand Down Expand Up @@ -406,11 +402,11 @@ chrome.storage.local.get(defaults, function (options) {

// TODO hack needed to work around non-spec-compliant versions of Chrome
// https://code.google.com/p/chromium/issues/detail?id=157855
if (document.compatMode === "BackCompat") {
return findScrollTop(document.body);
if (document.compatMode === "CSS1Compat") {
return findScrollTop(htmlNode);

} else {
return findScrollTop(htmlNode);
return findScrollTop(document.body);
}
}

Expand Down

0 comments on commit 360168d

Please sign in to comment.