Template talk:Toggler

From AkanaWiki
Jump to navigation Jump to search

Issues

  • template does not work correctly when a to-be-hidden element belongs to several classes: element will be hidden even if all others of that class are shown.
    • possible solution: add a switch _hideexcept to the .js file which
      • checks if the element has more than one class
      • reads all class names of the element into an array
      • skips the class name of the toggle call
      • checks all other class names for the display value of the corresponding toggler (which must receive a tag id="_toggle-anchor-{{{CLASS}}} from Template:Event)
      • breaks if any such toggler with a value other than "none" is found
  • also needed: a way to deal with higher-level switches.
    • probably best: give separate variables for each subgroup
      • "show" would work if _toggler_show-{{{1}}} (etc.) was repeated here in this template, counting to the maximum occurring number of regions in a group.
      • "hide" requires the same _hideexcept check as above, but that check must ignore all of the classes referring to sub-regions.
      • the sub-region togglers should all be set to the correct value as well, which requires repeated _toggler_show--_toggle-anchor-{{{1}}} (I hope).
        • this may become difficult if we have higher-level switches with overlapping sub-regions, because then we would also have to change the toggle state of the other higher-level switch - for advanced programmers only ;)


note: these are mainly notes to myself. if anyone is good with javascript, please contact me. Cedh 19:51, 21 July 2008 (UTC)