]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/ajax-form.js
Started refactor and alignment of component system
[bookstack] / resources / js / components / ajax-form.js
index 91029d04221247cbc4b079fd3d807a4eb25cb93f..6f4e5af08c8bfbe20483ea0805cf4a44261c3861 100644 (file)
@@ -1,4 +1,5 @@
 import {onEnterPress, onSelect} from "../services/dom";
+import {Component} from "./component";
 
 /**
  * Ajax Form
@@ -8,10 +9,8 @@ import {onEnterPress, onSelect} from "../services/dom";
  *
  * Will handle a real form if that's what the component is added to
  * otherwise will act as a fake form element.
- *
- * @extends {Component}
  */
-class AjaxForm {
+export class AjaxForm extends Component {
     setup() {
         this.container = this.$el;
         this.responseContainer = this.container;
@@ -72,11 +71,9 @@ class AjaxForm {
             this.responseContainer.innerHTML = err.data;
         }
 
-        window.components.init(this.responseContainer);
+        window.$components.init(this.responseContainer);
         this.responseContainer.style.opacity = null;
         this.responseContainer.style.pointerEvents = null;
     }
 
-}
-
-export default AjaxForm;
\ No newline at end of file
+}
\ No newline at end of file