X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/efe36f4f1b5df351eeb4d40a54c3900cf9a7079b..c45af498f0da72fb2cb9d2a50d1aa3f7429ecd25:/src/editor/modules/mainBar/mainBar.js?ds=inline diff --git a/src/editor/modules/mainBar/mainBar.js b/src/editor/modules/mainBar/mainBar.js index ecf6812..8658c27 100644 --- a/src/editor/modules/mainBar/mainBar.js +++ b/src/editor/modules/mainBar/mainBar.js @@ -7,8 +7,15 @@ define([ return function(sandbox) { - var view = $(_.template(template)()); - view.find('button').click(function(e) { + /* globals gettext*/ + + var config = sandbox.getConfig(), + userName = config.user && config.user.name, + view = $(_.template(template)({ + userName: userName || gettext('anonymous') + })); + + view.find('[data-cmd]').click(function(e) { e.preventDefault(); sandbox.publish('cmd.' + $(e.target).attr('data-cmd')); });