allowed clicking on the taskbar button itself to minimize

v1.18.x
Julian Lam 12 years ago
parent 9d3a27ea17
commit dd4bc61b5a

@ -238,6 +238,7 @@ define(['taskbar'], function(taskbar) {
return { return {
push: composer.push, push: composer.push,
load: composer.load load: composer.load,
minimize: composer.minimize
}; };
}); });

@ -16,15 +16,20 @@ define(function() {
// Posts bar events // Posts bar events
$(taskbar.taskbar).on('click', 'li', function() { $(taskbar.taskbar).on('click', 'li', function() {
var module = this.getAttribute('data-module'), var _btn = this,
module = this.getAttribute('data-module'),
uuid = this.getAttribute('data-uuid'); uuid = this.getAttribute('data-uuid');
require([module], function(module) { require([module], function(module) {
module.load(uuid); if (_btn.className.indexOf('active') === -1) {
module.load(uuid);
// Highlight the button // Highlight the button
$(taskbar.tasklist).removeClass('active'); $(taskbar.tasklist).removeClass('active');
this.className += ' active'; _btn.className += ' active';
} else {
module.minimize(uuid);
}
}); });
}); });
@ -54,6 +59,7 @@ define(function() {
'</a>'; '</a>';
btnEl.setAttribute('data-module', module); btnEl.setAttribute('data-module', module);
btnEl.setAttribute('data-uuid', uuid); btnEl.setAttribute('data-uuid', uuid);
btnEl.className = 'active';
taskbar.tasklist.appendChild(btnEl); taskbar.tasklist.appendChild(btnEl);
taskbar.update(); taskbar.update();

Loading…
Cancel
Save