mcopy/app/lib/ui/nav.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

const nav = {};
2016-06-19 00:13:33 +00:00
//NAV
nav.active = 'sequencer';
nav.init = function () {
'use strict';
$('#toolbar').w2toolbar({
name: 'toolbar',
items: [
{ type: 'radio', id: 'sequencer', group: '1', caption: 'Sequencer', icon: 'fa fa-th', checked: true },
{ type: 'radio', id: 'controls', group: '1', caption: 'Controls', icon: 'fa fa-tasks' },
{ type: 'radio', id: 'light', group: '1', caption: 'Light', icon: 'mcopy-light' },
2018-01-02 06:14:06 +00:00
{ type: 'radio', id: 'script', group: '1', caption: 'Script', icon: 'fa fa-code' },
{ type: 'radio', id: 'video', group: '1', caption : 'Film Out', icon: 'fa fa-video-camera'},
2016-06-19 00:13:33 +00:00
{ type: 'spacer' },
2018-01-02 06:14:06 +00:00
{ type: 'radio', id: 'settings', group: '1', caption: 'Settings', icon: 'fa fa-cogs' }
2016-06-19 00:13:33 +00:00
],
onClick : function (event) {
nav.change(event.target);
}
});
};
nav.change = function (id) {
'use strict';
nav.active = id;
$('.screen').hide();
$('#' + id).show();
if (id === 'light') {
2016-06-19 00:13:33 +00:00
if (w2ui['colors'].active === 'rgb') {
light.rgb.set(light.color);
}
} else if (id === 'script') {
mse.mscript.open();
2016-06-19 00:13:33 +00:00
}
};
module.exports = nav;