Skip to content

Commit

Permalink
For #2587: fixes and improvements
Browse files Browse the repository at this point in the history
- don't navigate if content is invalid
- sections/grids: readonly instead of non-relevant controls for better navigation
  • Loading branch information
ebruchez committed Mar 9, 2016
1 parent 6663254 commit fe776a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -42,6 +42,9 @@
<xf:setvalue ref="$i/initially-open" value="not($control/@fb:open = 'false')"/>
<xf:setvalue ref="$i/collapsible" value="(for $a in $control/(@collapse, @collapsible)[1] return $a = 'true', 'default')[1]"/>
</xf:action>
<xf:action if="not($i/container-type = 'section')">
<xf:setvalue ref="$i/initially-open" value="false()"/>
</xf:action>

<xf:setvalue ref="$i/was-repeat" value="fbf:isRepeat(fbf:findControlByNameOrEmpty($form, $i/control-name))"/>
<xf:setvalue ref="$i/is-repeat" value="$i/was-repeat"/>
Expand Down Expand Up @@ -198,7 +201,7 @@
recurse="true"/>
</xbl:handler>
<!-- Prev and Next buttons -->
<xbl:handler event="DOMActivate" observer="prev-button next-button">
<xbl:handler event="DOMActivate" observer="prev-button next-button" if="valid($i)">

<xf:var
name="new-control-id"
Expand Down Expand Up @@ -294,13 +297,13 @@
<xf:bind
ref="initially-open"
type="xs:boolean"
relevant="$i/container-type = 'section'"
readonly="../collapsible = 'false'"
relevant="true()"
readonly="$i/container-type = 'grid' or ../collapsible = 'false'"
calculate="if (../collapsible = 'false') then 'true' else ."/>

<xf:bind
ref="collapsible"
relevant="$i/container-type = 'section'"/>
readonly="$i/container-type = 'grid'"/>

<xf:bind
ref="was-repeat | is-repeat | was-custom-iteration-name | is-custom-iteration-name | apply-defaults | initial-iterations"
Expand Down
Expand Up @@ -282,7 +282,7 @@

</xbl:handler>
<!-- Prev and Next buttons -->
<xbl:handler event="DOMActivate" observer="prev-button next-button">
<xbl:handler event="DOMActivate" observer="prev-button next-button" if="valid($i)">

<xf:var
name="new-control-id"
Expand Down

0 comments on commit fe776a1

Please sign in to comment.