| 1 |
class ControlMeta { |
| 2 |
constructor( controlNode ) { |
| 3 |
this.controlNode = controlNode; |
| 4 |
} |
| 5 |
|
| 6 |
getImageId() { |
| 7 |
return this.controlNode.dataset?.imageOptimizationImageId |
| 8 |
? parseInt( this.controlNode.dataset?.imageOptimizationImageId, 10 ) |
| 9 |
: null; |
| 10 |
} |
| 11 |
|
| 12 |
getAction() { |
| 13 |
return this.controlNode.dataset?.imageOptimizationAction || null; |
| 14 |
} |
| 15 |
|
| 16 |
getContext() { |
| 17 |
return this.controlNode.dataset?.imageOptimizationContext || null; |
| 18 |
} |
| 19 |
|
| 20 |
getStatus() { |
| 21 |
return this.controlNode.dataset?.imageOptimizationStatus || null; |
| 22 |
} |
| 23 |
|
| 24 |
canBeRestored() { |
| 25 |
const value = this.controlNode.dataset?.imageOptimizationCanBeRestored; |
| 26 |
|
| 27 |
if ( ! value ) { |
| 28 |
return null; |
| 29 |
} |
| 30 |
|
| 31 |
return '1' === value; |
| 32 |
} |
| 33 |
|
| 34 |
allowRetry() { |
| 35 |
return this.controlNode.dataset?.allowRetry || null; |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
export default ControlMeta; |
| 40 |
|