EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: sky-t on February 07, 2020, 02:26:30 AM



Title: Hide Window without Closing
Post by: sky-t on February 07, 2020, 02:26:30 AM
Hi there,

is there a chance to completely hide a window (incl. title) without closing is (so i can show it again if needed)?


Title: Re: Hide Window without Closing
Post by: jarry on February 11, 2020, 08:56:46 PM
Please extend 'show' and 'hide' methods for the window component.
Code:
$.extend($.fn.window.methods, {
hide: function(jq){
return jq.each(function(){
var w = $(this);
var state = w.data('window');
state.window.hide();
if (state.shadow){state.shadow.hide();}
if (state.mask){state.mask.hide();}
})
},
show: function(jq){
return jq.each(function(){
var w = $(this);
var state = w.data('window');
state.window.show();
if (state.shadow){state.shadow.show();}
if (state.mask){state.mask.show();}
})
}
})

Usage examples.
Code:
$('#w').window('show');  // display the window
$('#w').window('hide');   // hide the window without closing it