summaryrefslogtreecommitdiff
path: root/minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-25 13:13:57 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-25 13:13:57 +0100
commitd25ff2bddd44b9dac1ceb248424109d1782dd211 (patch)
tree34fcfd824a1a72e7b4d431b688adcea532b62180 /minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js
parenta2cbdd1b88ac723e5e441c0a3c22636f0a8c4dfd (diff)
downloadmeta-d25ff2bddd44b9dac1ceb248424109d1782dd211.tar.gz
meta-d25ff2bddd44b9dac1ceb248424109d1782dd211.zip
add minionlivesmatter as submodule
Diffstat (limited to 'minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js')
-rw-r--r--minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js88
1 files changed, 0 insertions, 88 deletions
diff --git a/minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js b/minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js
deleted file mode 100644
index 283b976..0000000
--- a/minionlivesmatter/templates/assets/bootstrap-material-design/js/base.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import Util from './util'
-
-const Base = (($) => {
-
- const ClassName = {
- BMD_FORM_GROUP: 'bmd-form-group',
- IS_FILLED: 'is-filled',
- IS_FOCUSED: 'is-focused'
- }
-
- const Selector = {
- BMD_FORM_GROUP: `.${ClassName.BMD_FORM_GROUP}`
- }
-
- const Default = {}
-
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
- class Base {
-
- /**
- *
- * @param element
- * @param config
- * @param properties - anything that needs to be set as this[key] = value. Works around the need to call `super` before using `this`
- */
- constructor($element, config, properties = {}) {
- this.$element = $element
- this.config = $.extend(true, {}, Default, config)
-
- // set properties for use in the constructor initialization
- for (let key in properties) {
- this[key] = properties[key]
- }
- }
-
- dispose(dataKey) {
- this.$element.data(dataKey, null)
- this.$element = null
- this.config = null
- }
-
- // ------------------------------------------------------------------------
- // protected
-
- addFormGroupFocus() {
- if (!this.$element.prop('disabled')) {
- this.$bmdFormGroup.addClass(ClassName.IS_FOCUSED)
- }
- }
-
- removeFormGroupFocus() {
- this.$bmdFormGroup.removeClass(ClassName.IS_FOCUSED)
- }
-
- removeIsFilled() {
- this.$bmdFormGroup.removeClass(ClassName.IS_FILLED)
- }
-
- addIsFilled() {
- this.$bmdFormGroup.addClass(ClassName.IS_FILLED)
- }
-
- // Find bmd-form-group
- findMdbFormGroup(raiseError = true) {
- let mfg = this.$element.closest(Selector.BMD_FORM_GROUP)
- if (mfg.length === 0 && raiseError) {
- $.error(`Failed to find ${Selector.BMD_FORM_GROUP} for ${Util.describe(this.$element)}`)
- }
- return mfg
- }
-
- // ------------------------------------------------------------------------
- // private
-
- // ------------------------------------------------------------------------
- // static
-
- }
-
- return Base
-
-})(jQuery)
-
-export default Base