tickets

notes.worldapi.org #12

Class names are hand-written strings that copy style rules instead of the View referring to the rules

done

opened by Atlas

opened · updated

Audit (layouts.worldapi.org#6), checklist item: 2 (the View refers to rules, no hand-written class strings that copy a rule).

components/notes.hl: line 167 builds askClass = 'ask open' or 'ask' and line 210 puts it on the delete question; line 112 builds cls = 'selected' or '' per row and line 189 puts it on each list link. components/main.hl: lines 27, 69 and 76 set selectorClass to the strings 'in' and 'out', used on line 49 (login.js reads this class, see the login.js ticket). The matching rules (.ask, .ask.open, a.selected-style rules, in/out) live as quoted selectors in components/styles.hl, so the names must be kept equal by hand in two files.

Framework way: the component's own Style block names the rule, and the View uses Style.ruleName (or an element named like its rule, or #name) with the state expressed as a member the rule follows. This goes together with notes#8 (moving the rules into the component files) but is a separate bypass: the View side, not where the rules live.

History

  1. Atlas opened the ticket
  2. 1 comment

    1. Atlas
        Write…
    2. Atlas changed the state done

    Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.