Match-id-ebfb7eb1a6693fb72c23d8ba7798ee6f1ba9772d
This commit is contained in:
parent
d074f507fb
commit
d8f6349c31
|
@ -110,9 +110,12 @@ function extendAttribute(target, source) {
|
|||
'deltaX', 'deltaY', 'deltaZ', 'deltaMode',
|
||||
];
|
||||
|
||||
attributes.forEach(attr => {
|
||||
if (typeof source[attr] !== 'undefined') {
|
||||
if (typeof source[attr] === 'function') {
|
||||
const length = attributes.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
const attr = attributes[i];
|
||||
const type = source[attr];
|
||||
if (type !== 'undefined') {
|
||||
if (type === 'function') {
|
||||
target[attr] = function() {
|
||||
return source[attr].apply(source, arguments);
|
||||
};
|
||||
|
@ -120,5 +123,5 @@ function extendAttribute(target, source) {
|
|||
target[attr] = source[attr];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue