From d42c8b528eb595101954f478e0024e3f079f6fbf Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 22 Mar 2017 19:19:26 +0100 Subject: first implementation of fun stats site --- .../js/baseFormControl.js | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 templates/assets/bootstrap-material-design/js/baseFormControl.js (limited to 'templates/assets/bootstrap-material-design/js/baseFormControl.js') 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 -- cgit v1.3.1