Skip to content

Commit

Permalink
Simplify ‚Add type‘ popup in folder view.
Browse files Browse the repository at this point in the history
- Removed Label (really, just made it invisible, so it is only visible to screen readers)
- Added Disabled initial label, that acts as a default selection so the popup explains itself
- Ensured that after a selection the popup is reset to the default choice.

All these changes achieve a much simpler add menu, that reliably works even if you want to select the same entry multiple times without reloading the page (i.e. when navigating back). 

Before these changes, this required the add button, as you could otherwise not add the same kind of element twice.
  • Loading branch information
dwt committed May 17, 2018
1 parent ab0326a commit 52de7c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OFS/zpt/main.zpt
Expand Up @@ -8,19 +8,19 @@
tal:attributes="action string:${request/URL1}/" >
<div class="form-group">
<label for="addItemSelect"
class="mr-2">Select type to add</label>
class="mr-2 sr-only">Select type to add</label>
<select class="form-control mr-2"
name=":action"
id="addItemSelect"
tal:attributes="onchange string:location.href='${request/URL1}/'+this.options[this.selectedIndex].value">
tal:attributes="onchange string:location.href='${request/URL1}/'+this.options[this.selectedIndex].value;;this.selectedIndex = 0">
<option value='' disabled selected>Select type to add</option>
<tal:option tal:repeat="mt here/filtered_meta_types">
<option tal:condition="mt/action"
tal:attributes="value mt/action"
tal:content="mt/name">Action</option>
</tal:option>
</select>
</div>
<input class="btn btn-outline-secondary" type="submit" name="submit" value="Add" />
</form>

<form name="objectItems"
Expand Down

0 comments on commit 52de7c4

Please sign in to comment.