mp-design-system 1.2.8 → 1.2.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/build/js/app.js +1 -1
- package/dist/build/js/app.js.map +1 -1
- package/dist/build/scss/main.css +1 -1
- package/dist/build/scss/main.css.map +1 -1
- package/package.json +1 -1
- package/src/_includes/components/comparison-table/comparison-table.scss +10 -2
- package/src/assets/js/imports/comparison.js +5 -6
package/package.json
CHANGED
@@ -38,10 +38,10 @@
|
|
38
38
|
|
39
39
|
thead {
|
40
40
|
th {
|
41
|
+
@include padding(0, '2xs');
|
41
42
|
border: 0;
|
42
43
|
text-align: center;
|
43
44
|
vertical-align: top;
|
44
|
-
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
@@ -62,6 +62,7 @@
|
|
62
62
|
|
63
63
|
&__buttons {
|
64
64
|
@include margin(0, 'auto');
|
65
|
+
@include padding-bottom('xs');
|
65
66
|
margin-top: 1.25rem !important;
|
66
67
|
display: inline-flex;
|
67
68
|
flex-direction: column;
|
@@ -104,7 +105,14 @@
|
|
104
105
|
|
105
106
|
tbody {
|
106
107
|
tr {
|
107
|
-
|
108
|
+
&:first-child th {
|
109
|
+
@include padding(0);
|
110
|
+
vertical-align: bottom;
|
111
|
+
}
|
112
|
+
|
113
|
+
&:not(.c-comparison-table__title) {
|
114
|
+
height: 48px;
|
115
|
+
}
|
108
116
|
|
109
117
|
td:first-child {
|
110
118
|
text-align: left;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
function Comparison() {
|
2
|
-
console.log(document.querySelectorAll('.c-comparison-table').parentElement)
|
3
2
|
document.querySelectorAll('.c-comparison-table').forEach(extractMobileComparison)
|
4
3
|
}
|
5
4
|
|
@@ -11,10 +10,10 @@ function extractMobileComparison(container) {
|
|
11
10
|
|
12
11
|
if (!body || !head || !mobile) return;
|
13
12
|
|
14
|
-
// Remove empty corner piece
|
15
|
-
const
|
16
|
-
|
17
|
-
|
13
|
+
// Remove empty corner piece
|
14
|
+
const productsInfo = Array.from(head.children[0].children).filter((x, i) => i).map(x => ({ info: x.innerHTML }));
|
15
|
+
const productsButtons = Array.from(head.children[1].children).filter((x, i) => i).map(x => ({ buttons: x.innerHTML }));
|
16
|
+
const products = productsInfo.map((info, index) => ({ ...info, ...productsButtons[index], table: [] }));
|
18
17
|
|
19
18
|
Array.from(body.children).forEach(row => {
|
20
19
|
// For table row headers, push to all products
|
@@ -45,7 +44,7 @@ function extractMobileComparison(container) {
|
|
45
44
|
|
46
45
|
function createMobileProduct(product) {
|
47
46
|
const parent = document.createElement('article');
|
48
|
-
parent.innerHTML = `${product.info}
|
47
|
+
parent.innerHTML = `${product.info}${product.buttons}
|
49
48
|
<table class="c-comparison-table">
|
50
49
|
${product.table.map(x => {
|
51
50
|
if (x.type === 'title') {
|