File tree 3 files changed +42
-0
lines changed
3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 67
67
68
68
< body >
69
69
< div class ="wrapper ">
70
+ < select id ="mainSelect ">
71
+ < option > Polygon</ option >
72
+ < option > Random Points</ option >
73
+ < option > Cluster the Points (K-Means)</ option >
74
+ < option > Centroids</ option >
75
+ < option > Voronoi</ option >
76
+ < option > Voronoi Clip</ option >
77
+ </ select >
70
78
< calcite-stepper icon numbered >
71
79
< calcite-stepper-item
72
80
item-title ="Polygon "
Original file line number Diff line number Diff line change @@ -356,6 +356,14 @@ let reRun2 = false;
356
356
let reRun3 = false ;
357
357
let reRun = false ;
358
358
359
+ // change handler for mobile-view select
360
+ let selector = document . querySelector ( "#mainSelect" ) ;
361
+ selector . addEventListener ( "change" , ( evt ) => {
362
+ let s2 = `calcite-stepper > *:nth-child(${ evt . target . selectedIndex + 1 } )` ;
363
+ document . querySelector ( s2 ) . click ( ) ;
364
+ selector . click ( ) ;
365
+ } ) ;
366
+
359
367
// Create click handlers:
360
368
for ( let i = 0 ; i < steps . length ; i ++ ) {
361
369
let selector = `calcite-stepper > *:nth-child(${ i + 1 } )` ;
@@ -425,6 +433,10 @@ for (let i = 0; i < steps.length; i++) {
425
433
}
426
434
}
427
435
436
+ // let selector = document.querySelectorAll("#mainSelect option")[i].value;
437
+ document . querySelector ( "#mainSelect" ) . value = document . querySelectorAll (
438
+ "#mainSelect option"
439
+ ) [ i ] . value ;
428
440
runForStep ( i ) ;
429
441
} ) ;
430
442
}
Original file line number Diff line number Diff line change @@ -39,3 +39,25 @@ calcite-stepper {
39
39
# codeBlock .linkWrapper {
40
40
text-align : right;
41
41
}
42
+
43
+ # mainSelect {
44
+ display : none;
45
+ }
46
+ @media (max-width : 1200px ) {
47
+ calcite-stepper {
48
+ display : none;
49
+ }
50
+ # mainSelect {
51
+ display : block;
52
+ }
53
+ # codeBlock {
54
+ bottom : 0px ;
55
+ right : 0px ;
56
+ left : 0px ;
57
+ height : 143px ;
58
+ overflow-y : auto;
59
+ top : auto;
60
+ width : auto;
61
+ padding-bottom : 20px ;
62
+ }
63
+ }
You can’t perform that action at this time.
0 commit comments