summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerrence Tempest Wood <terrence@tempestwood.com>2016-08-05 16:31:24 +1200
committerWilson Page <wilsonpage@me.com>2016-08-05 09:25:00 +0100
commit5614caa7cb6577810f836bb532098581f1283e42 (patch)
treec74733e34d61a37d4862b638f0342394c4527071
parente1bcd99ff100ef03793009a320b8c02a65a907c0 (diff)
downloadfastdom-5614caa7cb6577810f836bb532098581f1283e42.zip
fastdom-5614caa7cb6577810f836bb532098581f1283e42.tar.gz
fastdom-5614caa7cb6577810f836bb532098581f1283e42.tar.bz2
Pass window into the closure
It seems `this= != window` inside browsrify closure, but actually `exports`.
-rw-r--r--fastdom-strict.js74
-rw-r--r--fastdom.js2
-rw-r--r--fastdom.min.js2
-rw-r--r--package.json2
4 files changed, 40 insertions, 40 deletions
diff --git a/fastdom-strict.js b/fastdom-strict.js
index 007521d..42c8a4a 100644
--- a/fastdom-strict.js
+++ b/fastdom-strict.js
@@ -119,7 +119,7 @@ return /******/ (function(modules) { // webpackBootstrap
*
* @type {Boolean}
*/
- var isWebkit = !!window.webkitURL;
+ // var isWebkit = !!window.webkitURL;
/**
* List of properties observed.
@@ -275,42 +275,42 @@ return /******/ (function(modules) { // webpackBootstrap
}
},
- innerWidth: {
- type: isWebkit ? Value : Measure,
-
- /**
- * Throws when the window is nested (in <iframe>)
- * and StrictDom is not in the 'measure' phase.
- *
- * @param {StrictDom} strictdom
- */
- test: function(strictdom) {
- var inIframe = window !== window.top;
- if (inIframe && strictdom.not('measure')) {
- throw error(2, '`.innerWidth` (in iframe)');
- }
- }
- },
-
- innerHeight: {
- type: isWebkit ? Value : Measure,
-
- /**
- * Throws when the window is nested (in <iframe>)
- * and StrictDom is not in the 'measure' phase.
- *
- * @param {StrictDom} strictdom
- */
- test: function(strictdom) {
- var inIframe = window !== window.top;
- if (inIframe && strictdom.not('measure')) {
- throw error(2, '`.innerHeight` (in iframe)');
- }
- }
- },
-
- scrollX: isWebkit ? Value : Measure,
- scrollY: isWebkit ? Value : Measure,
+ // innerWidth: {
+ // type: isWebkit ? Value : Measure,
+ //
+ // /**
+ // * Throws when the window is nested (in <iframe>)
+ // * and StrictDom is not in the 'measure' phase.
+ // *
+ // * @param {StrictDom} strictdom
+ // */
+ // test: function(strictdom) {
+ // var inIframe = window !== window.top;
+ // if (inIframe && strictdom.not('measure')) {
+ // throw error(2, '`.innerWidth` (in iframe)');
+ // }
+ // }
+ // },
+ //
+ // innerHeight: {
+ // type: isWebkit ? Value : Measure,
+ //
+ // /**
+ // * Throws when the window is nested (in <iframe>)
+ // * and StrictDom is not in the 'measure' phase.
+ // *
+ // * @param {StrictDom} strictdom
+ // */
+ // test: function(strictdom) {
+ // var inIframe = window !== window.top;
+ // if (inIframe && strictdom.not('measure')) {
+ // throw error(2, '`.innerHeight` (in iframe)');
+ // }
+ // }
+ // },
+ //
+ // scrollX: isWebkit ? Value : Measure,
+ // scrollY: isWebkit ? Value : Measure,
scrollBy: Mutate,
scrollTo: Mutate,
scroll: Mutate,
diff --git a/fastdom.js b/fastdom.js
index 4b7ab70..7ea5c85 100644
--- a/fastdom.js
+++ b/fastdom.js
@@ -239,4 +239,4 @@ var exports = win.fastdom = (win.fastdom || new FastDom()); // jshint ignore:lin
if ((typeof define)[0] == 'f') define(function() { return exports; });
else if ((typeof module)[0] == 'o') module.exports = exports;
-})(this);
+})( window || this);
diff --git a/fastdom.min.js b/fastdom.min.js
index 7c04550..a1ae649 100644
--- a/fastdom.min.js
+++ b/fastdom.min.js
@@ -1 +1 @@
-!function(t){"use strict";function e(){var e=this;e.reads=[],e.writes=[],e.raf=a.bind(t)}function n(t){t.scheduled||(t.scheduled=!0,t.raf(i.bind(null,t)))}function i(t){var e,i=t.writes,o=t.reads;try{r(o),r(i)}catch(s){e=s}if(t.scheduled=!1,(o.length||i.length)&&n(t),e){if(!t["catch"])throw e;t["catch"](e)}}function r(t){for(var e;e=t.shift();)e()}function o(t,e){var n=t.indexOf(e);return!!~n&&!!t.splice(n,1)}function s(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}var a=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16)};e.prototype={constructor:e,measure:function(t,e){var i=e?t.bind(e):t;return this.reads.push(i),n(this),i},mutate:function(t,e){var i=e?t.bind(e):t;return this.writes.push(i),n(this),i},clear:function(t){return o(this.reads,t)||o(this.writes,t)},extend:function(t){if("object"!=typeof t)throw new Error("expected object");var e=Object.create(this);return s(e,t),e.fastdom=this,e.initialize&&e.initialize(),e},"catch":null};var exports=t.fastdom=t.fastdom||new e;"f"==(typeof define)[0]?define(function(){return exports}):"o"==(typeof module)[0]&&(module.exports=exports)}(this);
+!function(t){"use strict";function e(){var e=this;e.reads=[],e.writes=[],e.raf=a.bind(t)}function n(t){t.scheduled||(t.scheduled=!0,t.raf(i.bind(null,t)))}function i(t){var e,i=t.writes,o=t.reads;try{r(o),r(i)}catch(s){e=s}if(t.scheduled=!1,(o.length||i.length)&&n(t),e){if(!t["catch"])throw e;t["catch"](e)}}function r(t){for(var e;e=t.shift();)e()}function o(t,e){var n=t.indexOf(e);return!!~n&&!!t.splice(n,1)}function s(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}var a=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16)};e.prototype={constructor:e,measure:function(t,e){var i=e?t.bind(e):t;return this.reads.push(i),n(this),i},mutate:function(t,e){var i=e?t.bind(e):t;return this.writes.push(i),n(this),i},clear:function(t){return o(this.reads,t)||o(this.writes,t)},extend:function(t){if("object"!=typeof t)throw new Error("expected object");var e=Object.create(this);return s(e,t),e.fastdom=this,e.initialize&&e.initialize(),e},"catch":null};var exports=t.fastdom=t.fastdom||new e;"f"==(typeof define)[0]?define(function(){return exports}):"o"==(typeof module)[0]&&(module.exports=exports)}(window||this);
diff --git a/package.json b/package.json
index 7b4e599..ec3ed98 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,6 @@
"webpack": "^1.12.9"
},
"dependencies": {
- "strictdom": "^1.0.0"
+ "strictdom": "^1.0.1"
}
}