From 37334e291018fe66c10643aa81437455a67b93f0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 5 Jul 2013 14:33:06 -0400 Subject: [PATCH] fixing bug where clicking on a taskbar item would cause the page to re-ajaxify (due to href="#"). closed #50 --- public/src/modules/taskbar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/src/modules/taskbar.js b/public/src/modules/taskbar.js index 25c828b0cd..02ba6e7a8c 100644 --- a/public/src/modules/taskbar.js +++ b/public/src/modules/taskbar.js @@ -7,6 +7,7 @@ define(function() { var footerEl = document.getElementById('footer'); taskbar.taskbar = document.createElement('div'); + var jTaskbar = $(taskbar.taskbar); taskbar.taskbar.innerHTML = ''; taskbar.taskbar.className = 'taskbar navbar navbar-fixed-bottom'; taskbar.taskbar.id = 'taskbar'; @@ -15,7 +16,7 @@ define(function() { document.body.insertBefore(taskbar.taskbar, footerEl); // Posts bar events - $(taskbar.taskbar).on('click', 'li', function() { + jTaskbar.on('click', 'li', function() { var _btn = this, module = this.getAttribute('data-module'), uuid = this.getAttribute('data-uuid'); @@ -34,6 +35,10 @@ define(function() { }); }); + jTaskbar.on('click', 'li a', function(e) { + e.preventDefault(); + }); + taskbar.initialized = true; }, update: function() {