Can you restructure this per André's comments to better use his compile-time 
evaluator?  I think his comments also make the code much more readable.

On 2011-01-12, at 11:36, Max Carlson wrote:

> Change maxcarlson-20110112-6K9 by maxcarlson@friendly on 2011-01-12 08:29:25 
> PST
>    in /Users/maxcarlson/openlaszlo/trunk2
>    for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: First pass at commenting out non-mobile code for $mobile runtime
> 
> Bugs Fixed: LPP-9645 - add if (! $mobile) {...} blocks to DHTML LFC (partial)
> 
> Technical Reviewer: hminsky
> QA Reviewer: ptw
> 
> Details: Without trying too hard, I was able to reduce the total size of the 
> mobile LFC by ~1.6K compressed, down to 94k from 95.7k!  I think this is 
> moving in the right direction.
> 
> I could have been more aggressive, but I'm trying to not restructure the 
> code.  This means I have to leave some bits in, e.g.:
> 
>        if (this.quirks.ie_alpha_image_loader) {
> if (! $mobile) {
>            i._parent.style.display = '';
> }
>        } else {
>            i.style.display = '';
>        }
> 
> I could restructure a bit and eliminate the test, but this is just a first 
> pass...  Also, it would be nice if I could do things like:
> 
>    // IE calls `target` `srcElement`
>    var target = e.target 
> if (! $mobile) {
>    || e.srcElement;
> }
> 
> but that freaks out the parser.
> 
> Files:
> M       WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/maxcarlson-20110112-6K9.tar


Reply via email to