
Originally Posted by
slobo
but the taskbar and the start menu is still accessible
in case of a modal window...
Sorry, I'm very newbie in development of Ext applications. Next code (diff) is my little dirty hack that I use in my application based on desktop example:
Code:
Index: taskbar.js
===================================================================
--- taskbar.js (revision 1)
+++ taskbar.js (working copy)
@@ -383,6 +383,7 @@
* @class Ext.ux.TaskBar.TaskButton
* @extends Ext.Button
*/
+var _modalWinTitleSpanEl;
Ext.ux.TaskBar.TaskButton = function(win, el){
this.win = win;
Ext.ux.TaskBar.TaskButton.superclass.constructor.call(this, {
@@ -390,12 +391,23 @@
text: Ext.util.Format.ellipsis(win.title, 12),
renderTo: el,
handler : function(){
- if(win.minimized || win.hidden){
- win.show();
- }else if(win == win.manager.getActive()){
- win.minimize();
- }else{
- win.toFront();
+ var activeWindow = win.manager.getActive();
+ if (activeWindow && !activeWindow.modal) {
+ if(win.minimized || win.hidden){
+ win.show();
+ }else if(win == win.manager.getActive()){
+ win.minimize();
+ }else{
+ win.toFront();
+ }
+ } else {
+ var _t = Ext.query('div#' + activeWindow.id + ' div.x-window-tl div.x-window-tr div.x-window-tc div:only-child span:last-child');
+ _modalWinTitleSpanEl = Ext.get(_t[0]);
+ for (var i=200;i<=1200;i+=200) {
+ setTimeout("_modalWinTitleSpanEl.replaceClass('x-window-header-text', 'x-window-header-text-masked')", i);
+ i+=200;
+ setTimeout("_modalWinTitleSpanEl.replaceClass('x-window-header-text-masked', 'x-window-header-text')", i);
+ }
}
},
clickEvent:'mousedown',
This code forbids to be switched to other windows by a click in taskbar and does the text of heading of a modal window blinking. Also you need to add class x-window-header-text-masked, which contains "color:gray;".
Is there any nice solution for this task?