EasyUI Forum
April 23, 2024, 03:29:25 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Is it possible to maximize/restore onDoubleClicking the title bar?  (Read 4091 times)
Alfred
Full Member
***
Posts: 134


-Licensed User-


View Profile
« 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');
          }
}
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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');
}
})
Logged
Alfred
Full Member
***
Posts: 134


-Licensed User-


View Profile
« Reply #2 on: May 17, 2017, 05:25:42 AM »

Thanks a million. This is working perfect. How do I change the cursor to pointer?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!