Skip to content

Commit

Permalink
Updated ButtonGenerator class
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Matyushkin committed May 24, 2019
1 parent 9b7c264 commit fbd0cc3
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions vootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ButtonGenerator {
size: buttonSizeLarge
}
*/
getCssClasses(appearance) {
getCssClassesString(appearance) {
var classes = [
"btn"
];
Expand All @@ -67,11 +67,7 @@ class ButtonGenerator {
return classes.join(" ");
}

getName(appearance) {
return `vt-button-${appearance.style}`;
}

getPossibleNames(appearance) {
getComponentNameCombinations(appearance) {
let nameComponents = {
style: appearance.style ? "-" + appearance.style : "",
outline: appearance.outline ? "-outline" : "",
Expand Down Expand Up @@ -101,10 +97,10 @@ class ButtonGenerator {
}

register(appearance) {
let names = this.getPossibleNames(appearance);
let cssClasses = this.getCssClasses(appearance);
let componentNames = this.getComponentNameCombinations(appearance);
let cssClasses = this.getCssClassesString(appearance);

for (var name of names) {
for (var name of componentNames) {
Vue.component(name, {
data: function() {
return {
Expand Down Expand Up @@ -169,7 +165,7 @@ class ButtonGenerator {
return appearances;
}

registerAllAppearances() {
registerAllPossibleAppearances() {
let allAppearances = this.getPossibleAppearances();

for (var appearance of allAppearances) {
Expand All @@ -178,4 +174,4 @@ class ButtonGenerator {
}
}

new ButtonGenerator().registerAllAppearances();
new ButtonGenerator().registerAllPossibleAppearances();

0 comments on commit fbd0cc3

Please sign in to comment.