You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by li...@apache.org on 2008/03/10 01:52:27 UTC

svn commit: r635410 - /incubator/shindig/trunk/javascript/container/gadgets.js

Author: lindner
Date: Sun Mar  9 17:52:22 2008
New Revision: 635410

URL: http://svn.apache.org/viewvc?rev=635410&view=rev
Log:
Add a method to control the maximum height of a gadget when
using the dynamic height module
implements SHINDIG-117

Modified:
    incubator/shindig/trunk/javascript/container/gadgets.js

Modified: incubator/shindig/trunk/javascript/container/gadgets.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/gadgets.js?rev=635410&r1=635409&r2=635410&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/gadgets.js (original)
+++ incubator/shindig/trunk/javascript/container/gadgets.js Sun Mar  9 17:52:22 2008
@@ -231,6 +231,10 @@
 gadgets.IfrGadgetService.inherits(gadgets.GadgetService);
 
 gadgets.IfrGadgetService.prototype.setHeight = function(height) {
+  if (height > gadgets.container.maxheight_) {
+    height = gadgets.container.maxheight_;
+  }
+  
   var element = document.getElementById(this.f);
   if (element) {
     element.style.height = height + 'px';
@@ -633,6 +637,9 @@
   this.language_ = 'ALL';
   this.view_ = 'default';
   this.nocache_ = 1;
+
+  // signed max int
+  this.maxheight_ = 0x7FFFFFFF;
 };
 
 gadgets.Container.inherits(gadgets.Extensible);
@@ -672,8 +679,12 @@
 };
 
 gadgets.Container.prototype.setView = function(view) {
-    this.view_ = view;
+  this.view_ = view;
 };
+
+gadgets.Container.prototype.setMaxHeight = function(maxheight) {
+  this.maxheight_ = maxheight;
+};  
 
 gadgets.Container.prototype.getGadgetKey_ = function(instanceId) {
   return 'gadget_' + instanceId;