summaryrefslogtreecommitdiff
path: root/templates/assets/bootstrap-material-design/js/baseFormControl.js
diff options
context:
space:
mode:
Diffstat (limited to 'templates/assets/bootstrap-material-design/js/baseFormControl.js')
-rw-r--r--templates/assets/bootstrap-material-design/js/baseFormControl.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/templates/assets/bootstrap-material-design/js/baseFormControl.js b/templates/assets/bootstrap-material-design/js/baseFormControl.js
new file mode 100644
index 0000000..8481070
--- /dev/null
+++ b/templates/assets/bootstrap-material-design/js/baseFormControl.js
@@ -0,0 +1,36 @@
+import BaseInput from './baseInput'
+
+const BaseFormControl = (($) => {
+
+ /**
+ * ------------------------------------------------------------------------
+ * Constants
+ * ------------------------------------------------------------------------
+ */
+ const Default = {
+ requiredClasses: ['form-control']
+ }
+
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
+ class BaseFormControl extends BaseInput {
+
+ constructor($element, config) {
+ super($element, $.extend(true, Default, config))
+
+ // Initially mark as empty
+ if (this.isEmpty()) {
+ this.removeIsFilled()
+ }
+ }
+ }
+
+
+ return BaseFormControl
+
+})(jQuery)
+
+export default BaseFormControl