aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 79f22e62..007deaa8 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -279,6 +279,13 @@ function JQLiteController(element, name) {
function JQLiteInheritedData(element, name, value) {
element = jqLite(element);
+
+ // if element is the document object work with the html element instead
+ // this makes $(document).scope() possible
+ if(element[0].nodeType == 9) {
+ element = element.find('html');
+ }
+
while (element.length) {
if (value = element.data(name)) return value;
element = element.parent();