Skip to content

Commit

Permalink
fix issue with bootstrap style
Browse files Browse the repository at this point in the history
  • Loading branch information
Keiwen committed Nov 21, 2017
1 parent f128d88 commit 152b19d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Enhanced checkboxes /radio input, component for vue 2+.
> Issue with ES2015 -> switch away in version 1.4
> Issue with bootstrap 3.3 on toggle component -> style fix in version 1.5
## Global use
- npm install
```
Expand Down Expand Up @@ -129,7 +131,7 @@ As classic radio buttons, model bound to value from checked input
### Toggle button
Checkbox is replaced by 2 switching labels, for on and off states
```
<enhanced-toggle label="Checkbox"></enhanced-check>
<enhanced-toggle></enhanced-check>
```
```
<enhanced-toggle :labelOn="tc_labelOn" :labelOff="tc_labelOff"
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-enhanced-check.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/dist/build.js

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-enhanced-check",
"version": "1.4.0",
"version": "1.5.0",
"description": "enhanced-check component for vue 2",
"author": "Keiwen <[email protected]>",
"private": false,
Expand All @@ -16,7 +16,6 @@
"url": "https://github.com/Keiwen/vue-enhancedCheck.git"
},
"dependencies": {
"bootstrap": "^3.3.7",
"vue": "^2.1.10"
},
"keywords": [
Expand Down
18 changes: 16 additions & 2 deletions src/components/EnhancedToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@
this.initLabelMaxWidth = this.getLabelMaxWidth();
this.initLabelMaxChar = this.getLabelMaxChar();
this.labelMaxWidth = this.initLabelMaxWidth;
this.labelMaxChar = this.initLabelMaxChar;
this.computeStyle()
this.labelMaxChar = this.initLabelMaxChar; this.computeStyle()
},
computed: {
computedClass () {
Expand Down Expand Up @@ -133,6 +132,8 @@
'--switchPos': (this.labelMaxWidth + HORIZONTAL_PADDING) + 'px',
'--toggleWidth': (this.labelMaxWidth + SWITCH_WIDTH/2 + HORIZONTAL_PADDING) + 'px'
}
console.log('pouet', this.style)
}
}
}
Expand All @@ -155,5 +156,18 @@
}
}
// !!! Style completely broken with bootstrap !!!
// following style is canceling bootstrap style
// seems that no effect without bootstrap
* {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
label {
max-width: none;
margin-bottom: 0;
}
</style>

0 comments on commit 152b19d

Please sign in to comment.