diff --git a/package.json b/package.json index 09c98f79..1f4c2f77 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "dependencies": { "bezier-easing": "^1.1.0", "clipboard": "^1.7.1", - "clunderscore": "^1.0.3", "compression": "^1.7.0", "diff-match-patch": "^1.0.0", "file-saver": "^1.3.3", diff --git a/src/components/App.vue b/src/components/App.vue index b15f1967..9d6434ef 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -22,6 +22,32 @@ Vue.directive('focus', { }, }); +const setVisible = (el, value) => { + el.style.display = value ? '' : 'none'; + if (value) { + el.removeAttribute('aria-hidden'); + } else { + el.setAttribute('aria-hidden', 'true'); + } +}; +Vue.directive('show', { + bind(el, { value }) { + setVisible(el, value); + }, + update(el, { value, oldValue }) { + if (value !== oldValue) { + setVisible(el, value); + } + }, +}); + +Vue.directive('title', { + bind(el, { value }) { + el.title = value; + el.setAttribute('aria-label', value); + }, +}); + export default { components: { Layout, diff --git a/src/components/ButtonBar.vue b/src/components/ButtonBar.vue index 9690027a..24a62744 100644 --- a/src/components/ButtonBar.vue +++ b/src/components/ButtonBar.vue @@ -1,24 +1,24 @@