If I create a modal window:
Ext.define(\'myWindow\', {
extend: \'Ext.Container\',
alias: \'widget.myWindow\',
floating: true,
modal: true,
li
I found adding a listener to the body and checking css classes felt a little hackey to me. You can actually override the private method _onMaskClick
of Ext.ZIndexManager
(see, completely not hackey). Which allows you to add your own configuration parameter (and even event) to all windows.
Ext.define('MyApp.ux.ZIndexManager_maskClick', {
override: 'Ext.ZIndexManager',
_onMaskClick: function ()
{
if (this.front)
{
var allowed = this.front.fireEvent('maskclick', this.front, this.mask);
if (allowed !== false && this.front.closeOnMaskClick)
this.front.close();
}
return this.callParent(arguments);
},
});