This commit is contained in:
张磊 2015-06-21 14:06:49 +08:00
parent 0a59e69cb7
commit 94567b01f3
3 changed files with 71 additions and 70 deletions

69
dist/nuclear.js vendored
View File

@ -1179,6 +1179,41 @@ var Nuclear = (function () {
})(Nuclear);
; (function ($) {
// __proto__ doesn't exist on IE<11, so redefine
// the Z function to use object extension instead
if (!('__proto__' in {})) {
$.extend($.nuclear, {
Z: function (dom, selector) {
dom = dom || []
$.extend(dom, $.fn)
dom.selector = selector || ''
dom.__Z = true
return dom
},
// this is a kludge but works
isZ: function (object) {
return $.type(object) === 'array' && '__Z' in object
}
})
}
// getComputedStyle shouldn't freak out when called
// without a valid element as argument
try {
getComputedStyle(undefined)
} catch (e) {
var nativeGetComputedStyle = getComputedStyle;
window.getComputedStyle = function (element) {
try {
return nativeGetComputedStyle(element)
} catch (e) {
return null
}
}
}
})(Nuclear)
; (function ($) {
var touch = {},
touchTimeout, tapTimeout, swipeTimeout, longTapTimeout,
@ -1341,41 +1376,7 @@ var Nuclear = (function () {
})
})(Nuclear)
; (function ($) {
// __proto__ doesn't exist on IE<11, so redefine
// the Z function to use object extension instead
if (!('__proto__' in {})) {
alert(11111)
$.extend($.nuclear, {
Z: function (dom, selector) {
dom = dom || []
$.extend(dom, $.fn)
dom.selector = selector || ''
dom.__Z = true
return dom
},
// this is a kludge but works
isZ: function (object) {
return $.type(object) === 'array' && '__Z' in object
}
})
}
// getComputedStyle shouldn't freak out when called
// without a valid element as argument
try {
getComputedStyle(undefined)
} catch (e) {
var nativeGetComputedStyle = getComputedStyle;
window.getComputedStyle = function (element) {
try {
return nativeGetComputedStyle(element)
} catch (e) {
return null
}
}
}
})(Nuclear)
Nuclear.create = function (obj) {
Nuclear._mixObj(obj);
if (!obj.statics) obj.statics = {};

2
dist/nuclear.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1160,6 +1160,41 @@ var Nuclear = (function () {
})(Nuclear);
; (function ($) {
// __proto__ doesn't exist on IE<11, so redefine
// the Z function to use object extension instead
if (!('__proto__' in {})) {
$.extend($.nuclear, {
Z: function (dom, selector) {
dom = dom || []
$.extend(dom, $.fn)
dom.selector = selector || ''
dom.__Z = true
return dom
},
// this is a kludge but works
isZ: function (object) {
return $.type(object) === 'array' && '__Z' in object
}
})
}
// getComputedStyle shouldn't freak out when called
// without a valid element as argument
try {
getComputedStyle(undefined)
} catch (e) {
var nativeGetComputedStyle = getComputedStyle;
window.getComputedStyle = function (element) {
try {
return nativeGetComputedStyle(element)
} catch (e) {
return null
}
}
}
})(Nuclear)
; (function ($) {
var touch = {},
touchTimeout, tapTimeout, swipeTimeout, longTapTimeout,
@ -1322,38 +1357,3 @@ var Nuclear = (function () {
})
})(Nuclear)
; (function ($) {
// __proto__ doesn't exist on IE<11, so redefine
// the Z function to use object extension instead
if (!('__proto__' in {})) {
alert(11111)
$.extend($.nuclear, {
Z: function (dom, selector) {
dom = dom || []
$.extend(dom, $.fn)
dom.selector = selector || ''
dom.__Z = true
return dom
},
// this is a kludge but works
isZ: function (object) {
return $.type(object) === 'array' && '__Z' in object
}
})
}
// getComputedStyle shouldn't freak out when called
// without a valid element as argument
try {
getComputedStyle(undefined)
} catch (e) {
var nativeGetComputedStyle = getComputedStyle;
window.getComputedStyle = function (element) {
try {
return nativeGetComputedStyle(element)
} catch (e) {
return null
}
}
}
})(Nuclear)