()
| 913 | } |
| 914 | |
| 915 | loadImage () { |
| 916 | const imageURL = this.get('image') |
| 917 | if (this.loadingImage) { return true } |
| 918 | if (this.loadedImage) { return false } |
| 919 | if (!imageURL) { return false } |
| 920 | this.image = $(`<img crossOrigin='Anonymous', src='/file/${imageURL}' />`) |
| 921 | this.loadingImage = true |
| 922 | this.image.one('load', () => { |
| 923 | this.loadingImage = false |
| 924 | this.loadedImage = true |
| 925 | this.buildSpriteSheet() |
| 926 | return this.trigger('image-loaded', this) |
| 927 | }) |
| 928 | this.image.one('error', () => { |
| 929 | this.loadingImage = false |
| 930 | return this.trigger('image-load-error', this) |
| 931 | }) |
| 932 | return true |
| 933 | } |
| 934 | |
| 935 | buildSpriteSheet () { |
| 936 | this.spriteSheet = new createjs.SpriteSheet({ |
nothing calls this directly
no test coverage detected