[limb-svn] r5947 - 3.x/trunk/limb/js/shared/js/limb
svn at limb-project.com
svn at limb-project.com
Wed Jun 6 13:31:23 MSD 2007
Author: pachanga
Date: 2007-06-06 13:31:22 +0400 (Wed, 06 Jun 2007)
New Revision: 5947
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5947
Modified:
3.x/trunk/limb/js/shared/js/limb/auto_popup.js
3.x/trunk/limb/js/shared/js/limb/forms.js
3.x/trunk/limb/js/shared/js/limb/window.js
Log:
-- added default Limb.Window settings to be applied to the newly opened window: LIMB_WINDOW_DEFAULT_PARAMS = {};
-- Limb.Window subscribes on load event as well, this is used to resize window according to user settings(LIMB_WINDOW_WIDTH, LIMB_WINDOW_HEIGHT)
Modified: 3.x/trunk/limb/js/shared/js/limb/auto_popup.js
===================================================================
--- 3.x/trunk/limb/js/shared/js/limb/auto_popup.js 2007-06-06 08:34:12 UTC (rev 5946)
+++ 3.x/trunk/limb/js/shared/js/limb/auto_popup.js 2007-06-06 09:31:22 UTC (rev 5947)
@@ -1,9 +1,9 @@
/*
* Limb PHP Framework
*
- * @link http://limb-project.com
+ * @link http://limb-project.com
* @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
jQuery(window).ready(
Modified: 3.x/trunk/limb/js/shared/js/limb/forms.js
===================================================================
--- 3.x/trunk/limb/js/shared/js/limb/forms.js 2007-06-06 08:34:12 UTC (rev 5946)
+++ 3.x/trunk/limb/js/shared/js/limb/forms.js 2007-06-06 09:31:22 UTC (rev 5947)
@@ -1,9 +1,9 @@
/*
* Limb PHP Framework
*
- * @link http://limb-project.com
+ * @link http://limb-project.com
* @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
Limb.namespace('Limb.Form');
Modified: 3.x/trunk/limb/js/shared/js/limb/window.js
===================================================================
--- 3.x/trunk/limb/js/shared/js/limb/window.js 2007-06-06 08:34:12 UTC (rev 5946)
+++ 3.x/trunk/limb/js/shared/js/limb/window.js 2007-06-06 09:31:22 UTC (rev 5947)
@@ -1,13 +1,17 @@
/*
* Limb PHP Framework
*
- * @link http://limb-project.com
+ * @link http://limb-project.com
* @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
- * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
Limb.namespace('Limb.Window');
+var LIMB_WINDOW_WIDTH = null;
+var LIMB_WINDOW_HEIGHT = null;
+var LIMB_WINDOW_DEFAULT_PARAMS = {};
+
Limb.Class('Limb.Window',
{
__construct: function()
@@ -29,6 +33,7 @@
{
this.window = this._createWindow(arguments[0], arguments[1], arguments[2]);
jQuery(this.window).ready(this.onOpen.bind(this));
+ jQuery(this.window).load(this.onLoad.bind(this));
jQuery(this.window).bind(this.window, 'close', this.onClose.bind(this));
}
},
@@ -89,10 +94,8 @@
this.windowName = windowName;
this.params = this._getDefaultParams();
+ this.params.merge(createParams || LIMB_WINDOW_DEFAULT_PARAMS);
- if(Limb.isset(createParams))
- this.params.merge(createParams);
-
var win = window.open(href, this.windowName, this.params.asString());
return win;
},
@@ -126,18 +129,35 @@
{
Limb.Window.register(this.windowName, this);
- if(this.params &&!this.params.getParameter('noautoresize'))
- this.autoResize();
+ this.autoResize();
this.centreWindow(this.params.getParameter('width'), this.params.getParameter('height'));
this.openHandler();
},
+ onLoad: function()
+ {
+ this.autoResize();
+
+ this.centreWindow(this.params.getParameter('width'), this.params.getParameter('height'));
+ },
+
autoResize: function()
{
- this.params.setParameter('width', this.parentWindow.getRect().getWidth() * 0.85);
- this.params.setParameter('height', this.parentWindow.getRect().getHeight() * 0.9);
+ if(!(this.params && !this.params.getParameter('noautoresize')) &&
+ !(this.window.LIMB_WINDOW_WIDTH || this.window.LIMB_WINDOW_HEIGHT))
+ return;
+
+ if(this.window.LIMB_WINDOW_WIDTH)
+ this.params.setParameter('width', this.window.LIMB_WINDOW_WIDTH);
+ else
+ this.params.setParameter('width', this.parentWindow.getRect().getWidth() * 0.85);
+
+ if(this.window.LIMB_WINDOW_HEIGHT)
+ this.params.setParameter('height', this.window.LIMB_WINDOW_HEIGHT);
+ else
+ this.params.setParameter('height', this.parentWindow.getRect().getHeight() * 0.9);
},
onClose: function()
More information about the limb-svn
mailing list