diff options
Diffstat (limited to 'src/elements/Image.js')
-rw-r--r-- | src/elements/Image.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/elements/Image.js b/src/elements/Image.js index 469e10a..c529439 100644 --- a/src/elements/Image.js +++ b/src/elements/Image.js @@ -1,5 +1,5 @@ import { isImage } from '../modules/core/regex.js' -import { nodeOrNew, register } from '../utils/adopter.js' +import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js' import { off, on } from '../modules/core/event.js' import { registerAttrHook } from '../modules/core/attr.js' import { registerMethods } from '../utils/methods.js' @@ -72,9 +72,9 @@ registerAttrHook(function (attr, val, _this) { registerMethods({ Container: { // create image element, load image and set its size - image (source, callback) { + image: wrapWithAttrCheck(function (source, callback) { return this.put(new Image()).size(0, 0).load(source, callback) - } + }) } }) |