mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Disable notification type/method combinations that are not available
This commit is contained in:
parent
ffca22dcc7
commit
f330561025
|
@ -9,6 +9,7 @@ export default Ember.Component.extend({
|
||||||
classNames: ['yesno-control'],
|
classNames: ['yesno-control'],
|
||||||
|
|
||||||
toggleState: true,
|
toggleState: true,
|
||||||
|
disabled: false,
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
var component = this;
|
var component = this;
|
||||||
|
|
|
@ -43,7 +43,8 @@ export default Ember.Component.extend({
|
||||||
type: type,
|
type: type,
|
||||||
method: method,
|
method: method,
|
||||||
enabled: !!user.get(preferenceKey),
|
enabled: !!user.get(preferenceKey),
|
||||||
loading: false
|
loading: false,
|
||||||
|
disabled: typeof user.get(preferenceKey) == 'undefined'
|
||||||
});
|
});
|
||||||
cell.set('save', function(value, component) {
|
cell.set('save', function(value, component) {
|
||||||
cell.set('loading', true);
|
cell.set('loading', true);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
border-bottom: 1px solid @fl-body-bg;
|
border-bottom: 1px solid @fl-body-bg;
|
||||||
color: @fl-body-control-color;
|
color: @fl-body-control-color;
|
||||||
}
|
}
|
||||||
& td, & th, & .yesno-cell .yesno {
|
& td, & th, & .yesno {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
}
|
}
|
||||||
& thead {
|
& thead {
|
||||||
|
@ -47,12 +47,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& .yesno-cell {
|
& .yesno-cell {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
& .yesno-control {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
& .yesno {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
&:hover, &.highlighted {
|
&:not(.disabled) {
|
||||||
background: darken(@fl-body-control-bg, 4%);
|
&:hover, &.highlighted {
|
||||||
|
background: darken(@fl-body-control-bg, 4%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& .toggle-group {
|
& .toggle-group {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="toggle-group" {{action "toggleType" row.type}}>{{row.label}}</td>
|
<td class="toggle-group" {{action "toggleType" row.type}}>{{row.label}}</td>
|
||||||
{{#each row.cells as |cell|}}
|
{{#each row.cells as |cell|}}
|
||||||
<td class="yesno-cell">{{ui/yesno-input toggleState=cell.enabled changed=cell.save loading=cell.loading}}</td>
|
<td class="yesno-cell">{{ui/yesno-input toggleState=cell.enabled changed=cell.save loading=cell.loading disabled=cell.disabled}}</td>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user