See the code below. Why is it so that window1 closes when the user is not answering ok or yes in the inner confirmation window?

Code:
var window1 = Ext.Msg.progress("window1");


window1.on({
    beforeclose: function(){
        Ext.Msg.confirm("Confirm","Close window1?",function(button){
            if( button==="ok" || button==="yes" )
                window1.close();
        });
        return false;
    }
});