Skip to content

Commit 578c4aa

Browse files
committed
Small fixes
- Fix md-icon-button not white on md-card-media-cover - Allow custom md-ratio - Fix cursor being a pointer when md-checkbox/md-radio is disabled - Allow md-radio to be toggled even if id/name is not set - Fix select all checkbox not updating when all md-table-row's are selected
1 parent aec7f58 commit 578c4aa

File tree

6 files changed

+44
-13
lines changed

6 files changed

+44
-13
lines changed

src/components/mdCard/mdCard.theme

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@
8989
background-color: #{'BACKGROUND-CONTRAST-0.4'};
9090
}
9191
}
92+
93+
.md-card-header,
94+
.md-card-actions {
95+
.md-icon-button:not(.md-primary):not(.md-warn):not(.md-accent) {
96+
.md-icon {
97+
color: #fff;
98+
}
99+
}
100+
}
92101
}
93102

94103
.md-card-expand {

src/components/mdCard/mdCardMedia.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@
1414
},
1515
computed: {
1616
classes() {
17-
let classes = {
18-
'md-16-9': this.mdRatio === '16:9' || this.mdRatio === '16/9',
19-
'md-4-3': this.mdRatio === '4:3' || this.mdRatio === '4/3',
20-
'md-1-1': this.mdRatio === '1:1' || this.mdRatio === '1/1'
21-
};
17+
let classes = {};
18+
19+
if (this.mdRatio) {
20+
let ratio = [];
21+
22+
if (this.mdRatio.indexOf(':') !== -1) {
23+
ratio = this.mdRatio.split(':');
24+
} else if (this.mdRatio.indexOf('/') !== -1) {
25+
ratio = this.mdRatio.split('/');
26+
}
27+
28+
if (ratio.length === 2) {
29+
classes['md-' + ratio[0] + '-' + ratio[1]] = true;
30+
}
31+
}
2232
2333
if (this.mdMedium || this.mdBig) {
2434
classes = {

src/components/mdCheckbox/mdCheckbox.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ $checkbox-touch-size: 48px;
88
margin: 16px 8px 16px 0;
99
display: inline-flex;
1010
position: relative;
11-
cursor: pointer;
11+
12+
&:not(.md-disabled) {
13+
cursor: pointer;
14+
15+
.md-checkbox-label {
16+
cursor: pointer;
17+
}
18+
}
1219

1320
.md-checkbox-container {
1421
width: $checkbox-size;
@@ -78,7 +85,6 @@ $checkbox-touch-size: 48px;
7885
height: $checkbox-size;
7986
padding-left: 8px;
8087
line-height: $checkbox-size;
81-
cursor: pointer;
8288
}
8389
}
8490

src/components/mdRadio/mdRadio.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ $radio-touch-size: 48px;
88
margin: 16px 8px 16px 0;
99
display: inline-flex;
1010
position: relative;
11-
cursor: pointer;
11+
12+
&:not(.md-disabled) {
13+
cursor: pointer;
14+
15+
.md-radio-label {
16+
cursor: pointer;
17+
}
18+
}
1219

1320
.md-radio-container {
1421
width: $radio-size;
@@ -71,7 +78,6 @@ $radio-touch-size: 48px;
7178
height: $radio-size;
7279
padding-left: 8px;
7380
line-height: $radio-size;
74-
cursor: pointer;
7581
}
7682
}
7783

src/components/mdRadio/mdRadio.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<div class="md-radio" :class="[themeClass, classes]">
3-
<div class="md-radio-container" @click="toggleCheck">
4-
<input type="radio" :name="name" :id="id" :disabled="disabled" :value="value" @click="toggleCheck">
3+
<div class="md-radio-container" @click.stop="toggleCheck">
4+
<input type="radio" :name="name" :id="id" :disabled="disabled" :value="value">
55
<md-ink-ripple :md-disabled="disabled" />
66
</div>
77

8-
<label :for="id || name" class="md-radio-label" v-if="$slots.default">
8+
<label :for="id || name" class="md-radio-label" v-if="$slots.default" @click="toggleCheck">
99
<slot></slot>
1010
</label>
1111
</div>

src/components/mdTable/mdTableRow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
},
6666
handleSingleSelection(value) {
6767
this.parentTable.setRowSelection(value, this.mdItem);
68-
this.parentTable.$children[0].checkbox = this.parentTable.numberOfSelected === this.parentTable.rowsCounter;
68+
this.parentTable.$children[0].checkbox = this.parentTable.numberOfSelected === this.parentTable.numberOfRows;
6969
},
7070
handleMultipleSelection(value) {
7171
if (this.parentTable.numberOfRows > 25) {

0 commit comments

Comments
 (0)