szurubooru/client/js/controllers/settings_controller.js

27 lines
732 B
JavaScript
Raw Normal View History

'use strict';
const router = require('../router.js');
const settings = require('../settings.js');
2016-06-13 22:34:39 +02:00
const TopNavigation = require('../models/top_navigation.js');
const SettingsView = require('../views/settings_view.js');
class SettingsController {
constructor() {
this._settingsView = new SettingsView();
}
registerRoutes() {
router.enter('/settings', (ctx, next) => { this._settingsRoute(); });
}
_settingsRoute() {
2016-06-13 22:34:39 +02:00
TopNavigation.activate('settings');
this._settingsView.render({
getSettings: () => settings.getSettings(),
saveSettings: newSettings => settings.saveSettings(newSettings),
});
}
};
module.exports = new SettingsController();