diff options
| author | rr- <rr-@sakuya.pl> | 2016-08-22 01:25:10 +0200 |
|---|---|---|
| committer | rr- <rr-@sakuya.pl> | 2016-08-22 01:40:30 +0200 |
| commit | d5e197e6ea353e1d635c33b95cd342d51c5baf76 (patch) | |
| tree | cd7277f5b7cdaf3cd1fa403efee9fe617d956b10 /client/html/posts_header.tpl | |
| parent | 44b2d9b830ad28c2d66ce7359191d24578b0a1c1 (diff) | |
client/general: add empty href for link buttons
In e464e69 I removed href='#' but I noticed that it broke some things.
Readding href serves two purposes:
- it makes links reachable with Tab key
- it makes links clickable with Enter key
The alternative to this approach was to introduce [tabindex] and [role]
attributes. But not only using tabindex=0 with <a/> is questionable,
it'd require adding a keyboard handler that'd intercept space and return
key presses and simulated link clicks. Since it's best to leave this
kind of thing to the native UI, I went with readding hrefs instead. I
believe that hash hrefs, even though being a common practice, are silly,
so I decided to settle down with empty hrefs.
As a bonus, I added a snippet that prevents middle mouse clicks from
opening such links/buttons in new tabs, which was the motivation for
e464e69.
Diffstat (limited to 'client/html/posts_header.tpl')
| -rw-r--r-- | client/html/posts_header.tpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/html/posts_header.tpl b/client/html/posts_header.tpl index 431a471..ea6b97d 100644 --- a/client/html/posts_header.tpl +++ b/client/html/posts_header.tpl @@ -12,11 +12,11 @@ <% if (ctx.parameters.tag) { %> <span class='append'>Tagging with:</span> <% } else { %> - <a class='mousetrap button append open-masstag'>Mass tag</a> + <a href class='mousetrap button append open-masstag'>Mass tag</a> <% } %> <%= ctx.makeTextInput({name: 'masstag', value: ctx.parameters.tag}) %> <input class='mousetrap start-tagging' type='submit' value='Start tagging'/> - <a class='mousetrap button append stop-tagging'>Stop tagging</a> + <a href class='mousetrap button append stop-tagging'>Stop tagging</a> </form> <% } %> </div> |