diff --git a/public/src/modules/taskbar.js b/public/src/modules/taskbar.js index d79e6bc710..6404ea34b3 100644 --- a/public/src/modules/taskbar.js +++ b/public/src/modules/taskbar.js @@ -2,38 +2,38 @@ define('taskbar', function() { var taskbar = { initialized: false, init: function() { - this.taskbar = $('
') - .html(' ') - .addClass('taskbar navbar navbar-default navbar-fixed-bottom') - .attr('id', 'taskbar'); - - this.tasklist = this.taskbar.find('ul'); - $(document.body).append(this.taskbar); - - // Posts bar events - this.taskbar.on('click', 'li', function() { - var $btn = $(this), - module = $btn.attr('data-module'), - uuid = $btn.attr('data-uuid'); - - require([module], function(module) { - if (!$btn.hasClass('active')) { - taskbar.minimizeAll(); - module.load(uuid); - taskbar.toggleNew(uuid, false); - app.alternatingTitle(''); - - // Highlight the button - taskbar.tasklist.removeClass('active'); - $btn.addClass('active'); - } else { - module.minimize(uuid); - } + var self = this; + + templates.parse('modules/taskbar', {}, function(html) { + self.taskbar = $(html); + self.tasklist = self.taskbar.find('ul'); + $(document.body).append(self.taskbar); + + // Posts bar events + self.taskbar.on('click', 'li', function() { + var $btn = $(this), + module = $btn.attr('data-module'), + uuid = $btn.attr('data-uuid'); + + require([module], function(module) { + if (!$btn.hasClass('active')) { + taskbar.minimizeAll(); + module.load(uuid); + taskbar.toggleNew(uuid, false); + app.alternatingTitle(''); + + // Highlight the button + taskbar.tasklist.removeClass('active'); + $btn.addClass('active'); + } else { + module.minimize(uuid); + } + }); + return false; }); - return false; - }); - taskbar.initialized = true; + taskbar.initialized = true; + }); }, update: function() {