Permalink
Browse files

fixed Android 2 and 4 and IE9 Mobile

  • Loading branch information...
1 parent b69c87b commit 74f93fd3671ad3af702fb7201ba0a245dada34c3 @WebReflection committed Aug 18, 2016
Oops, something went wrong.
Oops, something went wrong.
@@ -512,16 +512,32 @@ var
}
};
},
+ Promise = window.Promise || function (fn) {
+ var
+ notify = [],
+ done = false,
+ p = {
+ 'catch': function () {
+ return p;
+ },
+ 'then': function (cb) {
+ notify.push(cb);
+ if (done) setTimeout(resolve, 1);
+ return p;
+ }
+ }
+ ;
+ function resolve(value) {
+ done = true;
+ while (notify.length) notify.shift()(value);
+ }
+ fn(resolve);
+ return p;
+ },
justCreated = false,
constructors = Dict(null),
waitingList = Dict(null),
nodeNames = new Map(),
- /*
- bind = Object.bind || function () {
- var fn = this;
- return function () { return fn.call(this); };
- },
- */
// used to create unique instances
create = Object.create || function Bridge(proto) {
@@ -1233,12 +1249,13 @@ function whenDefined(name) {
}
try {
- (function (DRE) {
+ (function (DRE, options) {
+ options[EXTENDS] = 'a';
setPrototype(DRE.prototype, HTMLAnchorElement.prototype);
- customElements.define('document-register-element-a', DRE, {extends: 'a'});
+ customElements.define('document-register-element-a', DRE, options);
documentElement.insertBefore((DRE = new DRE()), documentElement.firstChild);
documentElement.removeChild(DRE);
- }(function () {}));
+ }(function () {}, {}));
} catch(o_O) {
delete window.customElements;
defineProperty(window, 'customElements', {
@@ -510,16 +510,32 @@ var
}
};
},
+ Promise = window.Promise || function (fn) {
+ var
+ notify = [],
+ done = false,
+ p = {
+ 'catch': function () {
+ return p;
+ },
+ 'then': function (cb) {
+ notify.push(cb);
+ if (done) setTimeout(resolve, 1);
+ return p;
+ }
+ }
+ ;
+ function resolve(value) {
+ done = true;
+ while (notify.length) notify.shift()(value);
+ }
+ fn(resolve);
+ return p;
+ },
justCreated = false,
constructors = Dict(null),
waitingList = Dict(null),
nodeNames = new Map(),
- /*
- bind = Object.bind || function () {
- var fn = this;
- return function () { return fn.call(this); };
- },
- */
// used to create unique instances
create = Object.create || function Bridge(proto) {
@@ -1231,12 +1247,13 @@ function whenDefined(name) {
}
try {
- (function (DRE) {
+ (function (DRE, options) {
+ options[EXTENDS] = 'a';
setPrototype(DRE.prototype, HTMLAnchorElement.prototype);
- customElements.define('document-register-element-a', DRE, {extends: 'a'});
+ customElements.define('document-register-element-a', DRE, options);
documentElement.insertBefore((DRE = new DRE()), documentElement.firstChild);
documentElement.removeChild(DRE);
- }(function () {}));
+ }(function () {}, {}));
} catch(o_O) {
delete window.customElements;
defineProperty(window, 'customElements', {
View
@@ -8,11 +8,8 @@
<meta names="apple-mobile-web-app-status-bar-style" content="black"/>
<!--[if lte IE 9]><script>(function(f){window.setTimeout=f(window.setTimeout);window.setInterval=f(window.setInterval)})(function(f){return function(c,t){var a=[].slice.call(arguments,2);return f(function(){c.apply(this,a)},t)}});</script><![endif]-->
<!--[if IE 8]><script src="//cdnjs.cloudflare.com/ajax/libs/ie8/0.2.3/ie8.js"></script><![endif]-->
- <script src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.4.5/dom4.js"></script>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.8.3/dom4.js"></script>
<!--[if IE 8]><script src="build/dre-ie8-upfront-fix.js"></script><![endif]-->
- <script>window.module = {};</script>
- <script src="http://npmcdn.com/[email protected]/promise.js"></script>
- <script>if (!window.Promise) window.Promise = module.exports; delete window.module;</script>
<script src="build/document-register-element.max.js"></script>
<script src="build/innerHTML.max.js"></script>
<script>
@@ -88,16 +88,32 @@ var
}
};
},
+ Promise = window.Promise || function (fn) {
+ var
+ notify = [],
+ done = false,
+ p = {
+ 'catch': function () {
+ return p;
+ },
+ 'then': function (cb) {
+ notify.push(cb);
+ if (done) setTimeout(resolve, 1);
+ return p;
+ }
+ }
+ ;
+ function resolve(value) {
+ done = true;
+ while (notify.length) notify.shift()(value);
+ }
+ fn(resolve);
+ return p;
+ },
justCreated = false,
constructors = Dict(null),
waitingList = Dict(null),
nodeNames = new Map(),
- /*
- bind = Object.bind || function () {
- var fn = this;
- return function () { return fn.call(this); };
- },
- */
// used to create unique instances
create = Object.create || function Bridge(proto) {
@@ -809,12 +825,13 @@ function whenDefined(name) {
}
try {
- (function (DRE) {
+ (function (DRE, options) {
+ options[EXTENDS] = 'a';
setPrototype(DRE.prototype, HTMLAnchorElement.prototype);
- customElements.define('document-register-element-a', DRE, {extends: 'a'});
+ customElements.define('document-register-element-a', DRE, options);
documentElement.insertBefore((DRE = new DRE()), documentElement.firstChild);
documentElement.removeChild(DRE);
- }(function () {}));
+ }(function () {}, {}));
} catch(o_O) {
delete window.customElements;
defineProperty(window, 'customElements', {

0 comments on commit 74f93fd

Please sign in to comment.