|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { Model } from 'backbone'; |
|
|
|
|
|
|
|
/** |
|
|
|
* @typedef Component |
|
|
|
* @typedef Device |
|
|
|
* @property {String} [name=''] Device type, eg. `Mobile` |
|
|
|
* @property {String} [width] Width to set for the editor iframe, eg. '900px' |
|
|
|
* @property {String} [height=''] Height to set for the editor iframe, eg. '600px' |
|
|
|
@ -29,14 +29,6 @@ export default class Device extends Model { |
|
|
|
toCheck.forEach(prop => this.checkUnit(prop)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Get device width. |
|
|
|
* @returns {String} |
|
|
|
*/ |
|
|
|
getWidth() { |
|
|
|
return this.get('width'); |
|
|
|
} |
|
|
|
|
|
|
|
checkUnit(prop) { |
|
|
|
const pr = this.get(prop) || ''; |
|
|
|
const noUnit = (parseFloat(pr) || 0).toString() === pr.toString(); |
|
|
|
|