summaryrefslogtreecommitdiff
path: root/misc/drupal.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-05-14 16:44:37 +0000
committerDries Buytaert <dries@buytaert.net>2010-05-14 16:44:37 +0000
commit24db763b78cdf6509a33c1312996b633ffcdcf36 (patch)
treee0d82757315955134febea6e9b923cddf978665f /misc/drupal.js
parente14705f4faed5703f547f95790ee1cc3524b46a4 (diff)
downloadbrdo-24db763b78cdf6509a33c1312996b633ffcdcf36.tar.gz
brdo-24db763b78cdf6509a33c1312996b633ffcdcf36.tar.bz2
- Patch #787940 by casey, Kiphaas7: generic approach for position:fixed elements like toolbar.
Diffstat (limited to 'misc/drupal.js')
-rw-r--r--misc/drupal.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/misc/drupal.js b/misc/drupal.js
index d6f7597c3..9d7ec8089 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -300,6 +300,24 @@ Drupal.getSelection = function (element) {
};
/**
+ * Checks if position:fixed is supported.
+ *
+ * @return
+ * Boolean indicating whether or not position:fixed is supported.
+ *
+ * @see http://yura.thinkweb2.com/cft/#IS_POSITION_FIXED_SUPPORTED
+ */
+Drupal.positionFixedSupported = function () {
+ if (this._positionFixedSupported === undefined) {
+ var el = $('<div style="position:fixed; top:10px" />').appendTo(document.body);
+ this._positionFixedSupported = el[0].offsetTop === 10;
+ el.remove();
+ }
+
+ return this._positionFixedSupported;
+};
+
+/**
* Build an error message from an AJAX response.
*/
Drupal.ajaxError = function (xmlhttp, uri) {