Author: max
Date: 2007-07-26 17:36:49 -0700 (Thu, 26 Jul 2007)
New Revision: 5820

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
Log:
Change 20070726-maxcarlson-t by [EMAIL PROTECTED] on 2007-07-26 14:55:06 PDT
    in /Users/maxcarlson/openlaszlo/legals-checkin
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix DHTML embedding to respect passed in values

New Features:

Bugs Fixed: LPP-4046 - DHTML embedding should respect passed in values, instead 
of the canvas values

Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: LzSprite.js - Store width, height and bgcolor values passed in for use 
by LaszloCanvas.lzs.

LaszloCanvas.lzs - Allow canvas sprite to overritde width, height and bgcolor
    

Tests: See LPP-4046.



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 
2007-07-27 00:28:09 UTC (rev 5819)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 
2007-07-27 00:36:49 UTC (rev 5820)
@@ -21,11 +21,24 @@
         var p = Lz.__propcache;
         var root = p.appenddiv;
 
-        if (p.bgcolor) div.style.backgroundColor = p.bgcolor; 
-        if (p.width) div.style.width = p.width; 
-        if (p.height) div.style.height = p.height; 
+        if (p.bgcolor) {
+            div.style.backgroundColor = p.bgcolor; 
+            this.bgcolor = p.bgcolor; 
+        }
+        if (p.width) {
+            div.style.width = p.width; 
+            var w = p.width.indexOf('%') != -1 ? p.width : parseInt(p.width);
+            this._w = w;
+            this.width = w;
+        }
+        if (p.height) {
+            div.style.height = p.height; 
+            var h = p.height.indexOf('%') != -1 ? p.height : 
parseInt(p.height);
+            this._h = h;
+            this.height = h;
+        }
         if (this.quirks.canvas_div_cannot_be_clipped  == false && p.width && 
p.width.indexOf('%') == -1 && p.height && p.height.indexOf('%') == -1 ) {
-            div.style.clip = 'rect(0px ' + p.width + ' ' + p.height + ' 0px)';
+            div.style.clip = 'rect(0px ' + this._w + ' ' + this._h + ' 0px)';
             div.style.overflow = 'hidden';
         }
         root.appendChild(div);
@@ -234,8 +247,8 @@
         // off for now
         //this.quirks['fix_clickable'] = true;
         if (Lz.__BrowserDetect.isIE) {
-            // Provide IE PNG/opacity support
             if (Lz.__BrowserDetect.version < 7) {
+                // Provide IE PNG/opacity support
                 this.quirks['ie_alpha_image_loader'] = true;
             } else {
                 this.quirks['invisible_parent_image_sizing_fix'] = true;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs   
2007-07-27 00:28:09 UTC (rev 5819)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs   
2007-07-27 00:36:49 UTC (rev 5820)
@@ -110,6 +110,15 @@
     delete args.proxied;
 
     this.sprite = new LzSprite(this, true);
+    if (this.sprite.width) {
+        args.width = this.sprite.width;
+    }
+    if (this.sprite.height) {
+        args.height = this.sprite.height;
+    }
+    if (this.sprite.bgcolor) {
+        args.bgcolor = this.sprite.bgcolor;
+    }
 
     this.__canvaswidthratio = null;
     this.width = Number(args.width);


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to