Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1.3 KiB

DeviceManager

Before using methods you should get first the module from the editor instance, in this way:

var deviceManager = editor.DeviceManager;

add

Add new device to the collection. URLs are supposed to be unique

Parameters

Examples

deviceManager.add('Tablet', '900px');
deviceManager.add('Tablet2', '900px', {
 height: '300px',
 widthMedia: '810px', // the width that will be used for the CSS media
});

Returns Device Added device

get

Return device by name

Parameters

  • name string Name of the device

Examples

var device = deviceManager.get('Tablet');
console.log(JSON.stringify(device));
// {name: 'Tablet', width: '900px'}

getAll

Return all devices

Examples

var devices = deviceManager.getAll();
console.log(JSON.stringify(devices));
// [{name: 'Desktop', width: ''}, ...]

Returns Collection