mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Switched to spaces
This commit is contained in:
@ -2,48 +2,48 @@ var App = App || {};
|
||||
App.Presenters = App.Presenters || {};
|
||||
|
||||
App.Presenters.HelpPresenter = function(
|
||||
jQuery,
|
||||
promise,
|
||||
util,
|
||||
topNavigationPresenter) {
|
||||
jQuery,
|
||||
promise,
|
||||
util,
|
||||
topNavigationPresenter) {
|
||||
|
||||
var $el = jQuery('#content');
|
||||
var templates = {};
|
||||
var activeTab;
|
||||
var $el = jQuery('#content');
|
||||
var templates = {};
|
||||
var activeTab;
|
||||
|
||||
function init(params, loaded) {
|
||||
topNavigationPresenter.select('help');
|
||||
topNavigationPresenter.changeTitle('Help');
|
||||
function init(params, loaded) {
|
||||
topNavigationPresenter.select('help');
|
||||
topNavigationPresenter.changeTitle('Help');
|
||||
|
||||
promise.wait(util.promiseTemplate('help'))
|
||||
.then(function(template) {
|
||||
templates.help = template;
|
||||
reinit(params, loaded);
|
||||
}).fail(function() {
|
||||
console.log(arguments);
|
||||
loaded();
|
||||
});
|
||||
}
|
||||
promise.wait(util.promiseTemplate('help'))
|
||||
.then(function(template) {
|
||||
templates.help = template;
|
||||
reinit(params, loaded);
|
||||
}).fail(function() {
|
||||
console.log(arguments);
|
||||
loaded();
|
||||
});
|
||||
}
|
||||
|
||||
function reinit(params, loaded) {
|
||||
activeTab = params.tab || 'about';
|
||||
render();
|
||||
loaded();
|
||||
}
|
||||
function reinit(params, loaded) {
|
||||
activeTab = params.tab || 'about';
|
||||
render();
|
||||
loaded();
|
||||
}
|
||||
|
||||
function render() {
|
||||
$el.html(templates.help({title: topNavigationPresenter.getBaseTitle() }));
|
||||
$el.find('.big-button').removeClass('active');
|
||||
$el.find('.big-button[href*="' + activeTab + '"]').addClass('active');
|
||||
$el.find('div[data-tab]').hide();
|
||||
$el.find('div[data-tab*="' + activeTab + '"]').show();
|
||||
}
|
||||
function render() {
|
||||
$el.html(templates.help({title: topNavigationPresenter.getBaseTitle() }));
|
||||
$el.find('.big-button').removeClass('active');
|
||||
$el.find('.big-button[href*="' + activeTab + '"]').addClass('active');
|
||||
$el.find('div[data-tab]').hide();
|
||||
$el.find('div[data-tab*="' + activeTab + '"]').show();
|
||||
}
|
||||
|
||||
return {
|
||||
init: init,
|
||||
reinit: reinit,
|
||||
render: render,
|
||||
};
|
||||
return {
|
||||
init: init,
|
||||
reinit: reinit,
|
||||
render: render,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user