diff options
author | Terrence Tempest Wood <terrence@tempestwood.com> | 2016-08-05 16:31:24 +1200 |
---|---|---|
committer | Wilson Page <wilsonpage@me.com> | 2016-08-05 09:25:00 +0100 |
commit | 5614caa7cb6577810f836bb532098581f1283e42 (patch) | |
tree | c74733e34d61a37d4862b638f0342394c4527071 | |
parent | e1bcd99ff100ef03793009a320b8c02a65a907c0 (diff) | |
download | fastdom-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.js | 74 | ||||
-rw-r--r-- | fastdom.js | 2 | ||||
-rw-r--r-- | fastdom.min.js | 2 | ||||
-rw-r--r-- | package.json | 2 |
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, @@ -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" } } |