EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Alfred on May 13, 2017, 10:59:57 AM



Title: Is it possible to maximize/restore onDoubleClicking the title bar?
Post by: Alfred on May 13, 2017, 10:59:57 AM
Is it possible to maximize and restore a window/dialogue on double-clicking the title bar of the window/the dialogue?
For example, my not so great assumption:

Code:
onDoubleClickTitle:function(){
          var ptitle = $(this).panel('options').title;
          if(ptitle.hasClass('panel-tool-max'){
             $(this).panel('maximize');
          }else{
              $(this).panel('restore');
          }
}


Title: Re: Is it possible to maximize/restore onDoubleClicking the title bar?
Post by: jarry on May 14, 2017, 05:13:14 PM
Please try this code:
Code:
var dlg = $('#dlg');
dlg.window('header').bind('dblclick', function(e){
var opts = dlg.window('options');
if (opts.maximized){
dlg.window('restore');
} else {
dlg.window('maximize');
}
})


Title: Re: Is it possible to maximize/restore onDoubleClicking the title bar?
Post by: Alfred on May 17, 2017, 05:25:42 AM
Thanks a million. This is working perfect. How do I change the cursor to pointer?