diff --git a/src/View.hs b/src/View.hs index 8014be9..9d6aaea 100644 --- a/src/View.hs +++ b/src/View.hs @@ -115,12 +115,16 @@ A section is something that can be shown or hidden. You define a section by usin renderEditbox ... +You can even give 2 names to a section – e.g. "normal editing" if you want the section be visible both in “normal” mode and in “editing” mode. + The list parameter is used to add attributes to the section. 'shown' is an attribute that means that the section is normally visible; 'noScriptShown' means that the section will be visible when Javascipt is disabled. Sections without either attribute will be hidden. (Usually 'shown' and 'noScriptShown' go together, but not always.) When several sections are in the same container (e.g. a
), you can toggle between them with 'JS.switchSection', which shows the section (or several sections) with given name, and hides all sections with other names. The elements that aren't sections are not affected. Also, there's another function available – 'JS.switchSectionEverywhere' – that switches sections everywhere inside the container, not only among container's direct children. It's useful when you have something like a list of pros/cons and you want to switch them all into the “editable” state. +//////////////////////////////////// + And now, here's how it's all implemented. In 'wrapPage' there's a piece of CSS wrapped in