|
|
|
r1745 | ptw | 2006-09-04 17:09:08 -0400 (Mon, 04 Sep 2006) | 21 lines
Changed paths: M /openlaszlo/branches/coal/WEB-INF/lps/lfc/core/LzNode.as M /openlaszlo/branches/coal/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java Change change.ptpIrl8ZB.txt by ptw@tin-woodsman.local /Users/ptw/pending-changes/ on 2006-09-04 12:41:24 EDT Summary: Make $styles inherit correctly from superclasses Bugs Fixed: Technical Reviewer: adam (Message-ID: <Pine.OSX.4.64.0609041106470.4824@axe.local>) QA Reviewer: ben (pending) Doc Reviewer: n/a Details: Define a default $styles method that returns null. The compiler-generated $styles method calls super.$styles and if it is a map, adds to that map, otherwise, creates and returns a new map. Change LzNode's initialize method to correctly invoke the $styles method, not the $styles function in the arglist. Tests: test/style/constraints/constraint-test.lzx |
||||||||||||||||||||||||||||||||||||||||||||||||||||
I think the simplest solution would be for me to redefine the $styles method
as follows:
function $styles () {
var map = super.$styles();
var styles = { ... };
for (var k in styles) { map[k] = styles[k]; };
return map;
}
That means you need a default $styles method on LzNode that returns a _new_
empty hash;
And you call __LZapplyStyleMap on this.$styles().