]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/user-select.js
Updated a whole load more js components
[bookstack] / resources / js / components / user-select.js
index c2c1f97c3aee5911fdb8c80ce4d63c5609370139..549963eed4193e6e5fc72ea46eadd73f77010e7a 100644 (file)
@@ -1,9 +1,9 @@
 import {onChildEvent} from "../services/dom";
+import {Component} from "./component";
 
-class UserSelect {
+export class UserSelect extends Component {
 
     setup() {
-
         this.input = this.$refs.input;
         this.userInfoContainer = this.$refs.userInfo;
 
@@ -14,13 +14,10 @@ class UserSelect {
 
     selectUser(event, userEl) {
         event.preventDefault();
-        const id = userEl.getAttribute('data-id');
-        this.input.value = id;
+        this.input.value = userEl.getAttribute('data-id');
         this.userInfoContainer.innerHTML = userEl.innerHTML;
         this.input.dispatchEvent(new Event('change', {bubbles: true}));
         this.hide();
     }
 
-}
-
-export default UserSelect;
\ No newline at end of file
+}
\ No newline at end of file