Skip to content

Commit 3646f4b

Browse files
committed
Add orientation property into bootstrap slider #220
1 parent 484e308 commit 3646f4b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/bootstrap-slider.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ function init(Survey) {
3030
default: 100,
3131
category: "general",
3232
},
33+
{
34+
name: "orientation",
35+
default: "horizontal",
36+
choices: ["horizontal", "vertical"],
37+
category: "general"
38+
},
3339
]);
3440
Survey.JsonObject.metaData.addProperty("bootstrapslider", {
3541
name: "config",
@@ -48,6 +54,10 @@ function init(Survey) {
4854
inputEl.setAttribute("data-slider-min", question.rangeMin);
4955
inputEl.setAttribute("data-slider-max", question.rangeMax);
5056
inputEl.setAttribute("data-slider-step", question.step);
57+
if(question.orientation == "vertical") {
58+
inputEl.setAttribute("data-slider-orientation", "vertical");
59+
}
60+
inputEl.setAttribute("data-slider-step", question.step);
5161
inputEl.setAttribute(
5262
"data-slider-value",
5363
question.value || question.rangeMin

src/nouislider.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ function init(Survey) {
5353
default: 5,
5454
},
5555
{
56-
name: "orientation:string",
56+
name: "orientation",
5757
category: "slider",
5858
default: "horizontal",
59+
choices: ["horizontal", "vertical"]
5960
},
6061
{
6162
name: "direction:string",

0 commit comments

Comments
 (0)