X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/412e60ded1457ec0f408e2234c9dd60122929bac..efe36f4f1b5df351eeb4d40a54c3900cf9a7079b:/src/editor/modules/mainBar/mainBar.js diff --git a/src/editor/modules/mainBar/mainBar.js b/src/editor/modules/mainBar/mainBar.js new file mode 100644 index 0000000..ecf6812 --- /dev/null +++ b/src/editor/modules/mainBar/mainBar.js @@ -0,0 +1,29 @@ +define([ +'libs/jquery', +'libs/underscore', +'libs/text!./template.html'], function($, _, template) { + +'use strict'; + +return function(sandbox) { + + var view = $(_.template(template)()); + view.find('button').click(function(e) { + e.preventDefault(); + sandbox.publish('cmd.' + $(e.target).attr('data-cmd')); + }); + + return { + start: function() { sandbox.publish('ready'); }, + getView: function() {return view;}, + setCommandEnabled: function(cmd, enabled) { + view.find('[data-cmd='+cmd+']').toggleClass('disabled', !enabled); + }, + setVersion: function(version) { + view.find('.version').text(version); + } + }; + +}; + +}); \ No newline at end of file