1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 02:55:47 +01:00

Add (considerably evil) dactylIUtils.getScrollable. Deal with some quirky sites without scrollable elements. Closes issue #525.

This commit is contained in:
Kris Maglione
2011-09-26 18:13:50 -04:00
parent 8900946cf2
commit 59daca20ba
4 changed files with 84 additions and 3 deletions

View File

@@ -691,6 +691,9 @@ var DOM = Class("DOM", {
createContents: function createContents()
this.each(DOM.createContents, this),
isScrollable: function isScrollable(direction)
this.length && DOM.isScrollable(this[0], direction),
getSet: function getSet(args, get, set) {
if (!args.length)
return this[0] && get.call(this, this[0]);
@@ -1246,6 +1249,10 @@ var DOM = Class("DOM", {
createContents: Class.Memoize(function () services.has("dactyl") && services.dactyl.createContents
|| function (elem) {}),
isScrollable: Class.Memoize(function () services.has("dactyl") && services.dactyl.getScrollable
? function (elem, dir) services.dactyl.getScrollable(elem) & (dir ? services.dactyl["DIRECTION_" + dir.toUpperCase()] : ~0)
: function (elem, dir) true),
/**
* The set of input element type attribute values that mark the element as
* an editable field.