| 8 | } |
| 9 | |
| 10 | get model() { |
| 11 | switch (this.type) { |
| 12 | case 'background': |
| 13 | return { |
| 14 | type: this.type, |
| 15 | imageId: this.imageId, |
| 16 | }; |
| 17 | case 'image': |
| 18 | return { |
| 19 | type: this.type, |
| 20 | imageId: this.imageId, |
| 21 | hyperlinks: this.range.hyperlinks, |
| 22 | range: { |
| 23 | tl: this.range.tl.model, |
| 24 | br: this.range.br && this.range.br.model, |
| 25 | ext: this.range.ext, |
| 26 | editAs: this.range.editAs, |
| 27 | }, |
| 28 | }; |
| 29 | default: |
| 30 | throw new Error('Invalid Image Type'); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | set model({type, imageId, range, hyperlinks}) { |
| 35 | this.type = type; |