R31569 - /branches/etemplate2/etemplate/js/dialog.js

Author: nathangray
New Revision: 31569

URL: http://www.egroupware.org/viewvc/egroupware?rev=31569&view=rev
Log:
Better handling for large content: js/dialog.js

  • Sanity check on dialog size, can’t be bigger than window
  • Scroll content div inside dialog if content is bigger than dialog

Modified:
branches/etemplate2/etemplate/js/dialog.js

Modified: branches/etemplate2/etemplate/js/dialog.js
URL: http://www.egroupware.org/viewvc/egroupware/branches/etemplate2/etemplate/js/dialog.js?rev=31569&r1=31568&r2=31569&view=diff

— branches/etemplate2/etemplate/js/dialog.js (original)
+++ branches/etemplate2/etemplate/js/dialog.js Thu Jul 29 22:29:05 2010
@@ -144,6 +144,18 @@
//Append the dialog div to the HTML body
$(‘body’).append(this.dialog_div);

  • // Sanity check for large dialogs - don’t run off the top & bottom of window
  • if(this.dialog_div.height() > $(window).height()) {
  •   this.height = $(window).height();
    
  •   this.dialog_div.css('height', $(window).height() + 'px');
    
  • }
  • // If height is set, set content size too so overflow scrolls
  • if(this.height) {
  •   // Not sure where that 11 comes from, but it needs to be there for proper alignment
    
  •   this.dialog_content_div.css('height', this.height - this.dialog_title_div.outerHeight(true) - 11 + 'px');
    
  • }
  • //Center the dialog
    this.center();
    }

The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs