addressed issue #50 with taskbar weirdness

v1.18.x
Julian Lam 12 years ago
parent 80519d4c97
commit b1e4aecdb0

@ -22,6 +22,7 @@ define(function() {
require([module], function(module) { require([module], function(module) {
if (_btn.className.indexOf('active') === -1) { if (_btn.className.indexOf('active') === -1) {
taskbar.minimizeAll();
module.load(uuid); module.load(uuid);
// Highlight the button // Highlight the button
@ -64,6 +65,8 @@ define(function() {
btnEl.setAttribute('data-module', module); btnEl.setAttribute('data-module', module);
btnEl.setAttribute('data-uuid', uuid); btnEl.setAttribute('data-uuid', uuid);
btnEl.className = options.state || 'active'; btnEl.className = options.state || 'active';
if (!options.state || options.state === 'active') taskbar.minimizeAll();
taskbar.tasklist.appendChild(btnEl); taskbar.tasklist.appendChild(btnEl);
taskbar.update(); taskbar.update();
@ -71,6 +74,9 @@ define(function() {
minimize: function(module, uuid) { minimize: function(module, uuid) {
var btnEl = taskbar.tasklist.querySelector('[data-module="' + module + '"][data-uuid="' + uuid + '"]'); var btnEl = taskbar.tasklist.querySelector('[data-module="' + module + '"][data-uuid="' + uuid + '"]');
$(btnEl).removeClass('active'); $(btnEl).removeClass('active');
},
minimizeAll: function() {
$(taskbar.tasklist.querySelectorAll('.active')).removeClass('active');
} }
} }

Loading…
Cancel
Save