@uploadcare/blocks
Version:
Building blocks for Uploadcare products integration
22 lines (17 loc) • 389 B
JavaScript
import { ImgBase } from './ImgBase.js';
export class Img extends ImgBase {
initCallback() {
super.initCallback();
this.sub$$('src', () => {
this.init();
});
this.sub$$('uuid', () => {
this.init();
});
this.sub$$('lazy', (val) => {
if (!this.$$('is-background-for')) {
this.img.loading = val ? 'lazy' : 'eager';
}
});
}
}