mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added support for parameters in presenters
This commit is contained in:
26
public_html/js/Presenters/UserPresenter.js
Normal file
26
public_html/js/Presenters/UserPresenter.js
Normal file
@ -0,0 +1,26 @@
|
||||
var App = App || {};
|
||||
App.Presenters = App.Presenters || {};
|
||||
|
||||
App.Presenters.UserPresenter = function(jQuery, topNavigationPresenter, appState) {
|
||||
|
||||
var $el = jQuery('#content');
|
||||
var userName;
|
||||
|
||||
function init(args) {
|
||||
userName = args.userName;
|
||||
topNavigationPresenter.select(appState.get('loggedIn') && appState.get('loggedInUser').name == userName ? 'my-account' : 'users');
|
||||
render();
|
||||
}
|
||||
|
||||
function render() {
|
||||
$el.html('Viewing user: ' + userName);
|
||||
};
|
||||
|
||||
return {
|
||||
init: init,
|
||||
render: render
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
App.DI.register('userPresenter', App.Presenters.UserPresenter);
|
Reference in New Issue
Block a user