Skip to content

Commit 342430b

Browse files
authored
Merge pull request #113 from ditdot-dev/disable-progress-bar
Disable progress bar option
2 parents c160d65 + 990a534 commit 342430b

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

examples/questionnaire/Example.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@
120120
id: 'multiple_choice',
121121
tagline: "FYI, You can always go back 👈, use the up arrow on the bottom.",
122122
title: 'Multiple choice question:',
123+
helpTextShow: false,
123124
type: QuestionType.MultipleChoice,
124125
multiple: false,
125-
helpText: ' ',
126126
allowOther: true,
127127
required: true,
128128
options: [

examples/quiz/Example.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
new QuestionModel({
135135
id: 'html_2',
136136
title: '<label> is associated with <input> using the "name" attribute.',
137+
helpTextShow: false,
137138
type: QuestionType.MultipleChoice,
138139
required: true,
139140
multiple: false,
@@ -234,7 +235,7 @@
234235
new QuestionModel({
235236
id: 'ux_2',
236237
title: 'Error messages are bad because they confuse users.',
237-
helpText: ' ',
238+
helpTextShow: false,
238239
type: QuestionType.MultipleChoice,
239240
multiple: false,
240241
required: true,
@@ -278,7 +279,7 @@
278279
new QuestionModel({
279280
id: 'ux_4',
280281
title: 'Inline validation should have a real time feedback.',
281-
helpText: ' ',
282+
helpTextShow: false,
282283
type: QuestionType.MultipleChoice,
283284
multiple: false,
284285
required: true,

src/components/FlowForm.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
<div class="f-footer">
5555
<div class="footer-inner-wrap">
56-
<div class="f-progress" v-bind:class="{'not-started': percentCompleted === 0, 'completed': percentCompleted === 100}">
56+
<div v-if="progressbar" class="f-progress" v-bind:class="{'not-started': percentCompleted === 0, 'completed': percentCompleted === 100}">
5757
<div class="f-progress-bar">
5858
<div class="f-progress-bar-inner" v-bind:style="'width: ' + percentCompleted + '%;'"></div>
5959
</div>
@@ -136,6 +136,10 @@
136136
language: {
137137
type: LanguageModel,
138138
default: () => new LanguageModel()
139+
},
140+
progressbar: {
141+
type: Boolean,
142+
default: true
139143
}
140144
},
141145
data() {

src/components/Question.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</span>
2929
</template>
3030

31-
<span class="f-sub" v-if="question.subtitle || question.type === QuestionType.LongText || question.type === QuestionType.MultipleChoice">
31+
<span class="f-sub" v-if="showHelperText">
3232
<span v-if="question.subtitle">{{ question.subtitle }}</span>
3333

3434
<span class="f-help" v-if="question.type === QuestionType.LongText && !isMobile" v-html="question.helpText || language.formatString(language.longTextHelpText)"></span>
@@ -240,6 +240,16 @@
240240
classes['field-' + this.question.type.toLowerCase().substring(8)] = true
241241
242242
return classes
243+
},
244+
245+
showHelperText() {
246+
if (this.question.subtitle) {
247+
return true
248+
}
249+
if (this.question.type === QuestionType.LongText || this.question.type === QuestionType.MultipleChoice) {
250+
return this.question.helpTextShow
251+
}
252+
return false
243253
}
244254
}
245255
}

src/models/QuestionModel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default class QuestionModel {
7272
this.content = null
7373
this.inline = false
7474
this.helpText = null
75+
this.helpTextShow = true;
7576

7677
Object.assign(this, options)
7778

0 commit comments

Comments
 (0)