Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
|
|
@ -0,0 +1,50 @@
|
|||
define([
|
||||
'require',
|
||||
'exports',
|
||||
'module',
|
||||
'debug',
|
||||
'views/indicators'
|
||||
], function (require, exports, module) {
|
||||
'use strict';
|
||||
var debug = require('debug')('controller:indicators');
|
||||
var IndicatorsView = require('views/indicators');
|
||||
module.exports = function (app) {
|
||||
return new IndicatorsController(app);
|
||||
};
|
||||
module.exports.IndicatorsController = IndicatorsController;
|
||||
function IndicatorsController(app) {
|
||||
this.app = app;
|
||||
this.settings = app.settings;
|
||||
this.configure = this.configure.bind(this);
|
||||
this.createView();
|
||||
this.configure();
|
||||
this.bindEvents();
|
||||
debug('initialized');
|
||||
}
|
||||
IndicatorsController.prototype.createView = function () {
|
||||
debug('create view');
|
||||
this.view = this.app.views.indicators || new IndicatorsView();
|
||||
this.view.appendTo(this.app.el);
|
||||
debug('view created');
|
||||
};
|
||||
IndicatorsController.prototype.bindEvents = function () {
|
||||
this.settings.countdown.on('change:selected', this.view.setter('countdown'));
|
||||
this.settings.mode.on('change:selected', this.view.setter('mode'));
|
||||
this.settings.hdr.on('change:selected', this.view.setter('hdr'));
|
||||
this.app.on('change:batteryStatus', this.view.setter('battery'));
|
||||
this.app.on('change:recording', this.view.setter('recording'));
|
||||
this.app.on('settings:configured', this.configure);
|
||||
this.app.on('settings:opened', this.view.setter('ariaHidden', true));
|
||||
this.app.on('settings:closed', this.view.setter('ariaHidden', false));
|
||||
this.app.on('previewgallery:opened', this.view.hide);
|
||||
this.app.on('previewgallery:closed', this.view.show);
|
||||
debug('events bound');
|
||||
};
|
||||
IndicatorsController.prototype.configure = function () {
|
||||
debug('configuring');
|
||||
this.view.set('hdr', this.settings.hdr.selected('key'));
|
||||
this.view.set('countdown', this.settings.countdown.selected('key'));
|
||||
this.view.set('battery', this.app.get('batteryStatus'));
|
||||
debug('configured');
|
||||
};
|
||||
});
|
||||
Loading…
Reference in a new issue