Titanium

[ALOY-108] tss file expr() syntax needs to be handled recursively

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-19T11:52:02.000+0000
Affected Version/s2012 Sprint 14
Fix Version/s2012 Sprint 14
ComponentsXML
Labelsn/a
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2012-07-18T07:48:34.000+0000
Updated2013-05-01T14:56:11.000+0000

Description

Problem

expr() syntax in tss files currently only works in a flat style definition with no nested objects. For example, the following style definition will parse the width correctly, but will not properly parse the fontSize:
".container": {
    "width": expr(Ti.Platform.displayCaps.platformWidth/2),
    "font": {
        "fontSize": expr(require('alloy/measurement').dpToPx(18))
    }
}

Proposed Solution

Processing of style attributes needs to be performed recursively. Right now, if an object type is encountered, it is simply returned as-is with no expr() evaluations. We need to pass the object back into the style parsing function to further process it to allow expr() syntax to work.

Comments

No comments

JSON Source