diff --git a/src/client/app/common/size.ts b/src/client/app/common/size.ts new file mode 100644 index 0000000000..6abb305747 --- /dev/null +++ b/src/client/app/common/size.ts @@ -0,0 +1,18 @@ +export default { + install(Vue) { + Vue.directive('size', { + inserted(el, binding) { + const query = binding.value; + const width = el.clientWidth; + for (const q of query) { + if (q.lt && (width <= q.lt)) { + el.classList.add(q.class); + } + if (q.gt && (width >= q.gt)) { + el.classList.add(q.class); + } + } + } + }); + } +}; diff --git a/src/client/app/common/views/components/user-list.vue b/src/client/app/common/views/components/user-list.vue index 35569687ba..3147fbe371 100644 --- a/src/client/app/common/views/components/user-list.vue +++ b/src/client/app/common/views/components/user-list.vue @@ -1,12 +1,17 @@