Skip to content

Commit

Permalink
Merge remote-tracking branch 'drount/master'
Browse files Browse the repository at this point in the history
This Fork is going to be a Bootstrap 4 solution.
This merge is going to add Bootstrap 4 compatability.
Maybe there has to be some more changes to the src.

Proposed in OneWayTech#87
  • Loading branch information
maltere committed Apr 2, 2018
2 parents 9936c88 + 00ff4d8 commit 25e2438
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/HeaderSettings/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="btn-group" name="HeaderSettings">
<button class="btn btn-default dropdown-toggle" ref="dropdownBtn" type="button">
<div class="dropdown" name="HeaderSettings">
<button data-toggle="dropdown" class="btn btn-default dropdown-toggle" ref="dropdownBtn" type="button">
<i class="fa" :class="[usingBak && 'text-info', processingCls || 'fa-cog']"></i>
<span class="caret"></span>
</button>
Expand Down Expand Up @@ -49,7 +49,6 @@ import groupBy from 'lodash/groupBy'
import keyGen from '../_utils/keyGen'
import replaceWith from '../_utils/replaceWith'
import { parseStr, stringify, saveToLS, rmFromLS, getFromLS } from '../_utils/localstorage'
export default {
name: 'HeaderSettings',
components: { ColumnGroup },
Expand All @@ -68,10 +67,8 @@ export default {
},
created () {
if (!this.supportBackup) return
const backup = getFromLS(this.storageKey)
if (!backup) return // no backup found
replaceWith(this.columns, backup)
this.usingBak = true
},
Expand All @@ -80,6 +77,7 @@ export default {
const $el = $(this.$el)
$(this.$refs.dropdownBtn).on('click', this.toggle)
$(document).on('click', e => {
$(e.target).closest($el).length || $el.removeClass('show') // Bootstrap 4
$(e.target).closest($el).length || $el.removeClass('open')
})
},
Expand Down Expand Up @@ -114,11 +112,13 @@ export default {
rmFromLS(this.storageKey)
this.showProcessing()
this.usingBak = false
replaceWith(this.columns, parseStr(this.origSettings)) // restore
},
toggle () {
$(this.$el).toggleClass('show') // Bootstrap 4
$(this.$el).toggleClass('open')
$(this.$el).find('.dropdown-menu').toggleClass('show')
},
showProcessing () {
['fa-spinner fa-pulse', 'fa-check', ''].forEach((cls, idx) => {
Expand Down

0 comments on commit 25e2438

Please sign in to comment.