Skip to content

Commit

Permalink
Merge pull request #5 from PDERAS/feature/fixed-expand-issue
Browse files Browse the repository at this point in the history
fixed collapse issue
  • Loading branch information
Strider committed Dec 31, 2019
2 parents 696a043 + 0a63ac9 commit 26f68f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/components/Foldable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<script>
/**
* Heavily stripped down version of https://github.com/ulivz/vue-foldable
*/
* Heavily stripped down version of https://github.com/ulivz/vue-foldable
*/
import defaults from '../options';
export default {
Expand Down Expand Up @@ -51,12 +51,16 @@ export default {
percentage: null
};
},
created: function() {
created: function () {
if (this.percentageMode) {
this.percentage =
parseInt(this.threshold.replace('%', '').trim()) / 100;
} else if (typeof this.height === 'string') {
this.currentMaxHeight = this.threshold = DEFAULT_VISUAL_HEIGHT;
} else {
if(!this.collapsed){
this.currentMaxHeight = 9999999;
} else {
this.currentMaxHeight = 0;
}
}
},
mounted: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ const VueFoldablePlugin = {

Vue.component(Foldable.name, Foldable);
}
}
};

export default VueFoldablePlugin;
2 changes: 1 addition & 1 deletion src/options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
peekabooHeight: 0
}
};

0 comments on commit 26f68f5

Please sign in to comment.