Browse Source

Update Device

pull/3725/head
Artur Arseniev 5 years ago
parent
commit
e991584629
  1. 6
      docs/api/device.md
  2. 10
      src/device_manager/model/Device.js

6
docs/api/device.md

@ -12,12 +12,6 @@
* `widthMedia` **[String][1]?** The width which will be used in media queries, If empty the width will be used
* `priority` **[Number][2]?** Setup the order of media queries
### getWidth
Get device width.
Returns **[String][1]**
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

10
src/device_manager/model/Device.js

@ -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();

Loading…
Cancel
Save