mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +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'],
|
||||
|
||||
toggleState: true,
|
||||
disabled: false,
|
||||
|
||||
didInsertElement: function() {
|
||||
var component = this;
|
||||
|
|
|
@ -43,7 +43,8 @@ export default Ember.Component.extend({
|
|||
type: type,
|
||||
method: method,
|
||||
enabled: !!user.get(preferenceKey),
|
||||
loading: false
|
||||
loading: false,
|
||||
disabled: typeof user.get(preferenceKey) == 'undefined'
|
||||
});
|
||||
cell.set('save', function(value, component) {
|
||||
cell.set('loading', true);
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
border-bottom: 1px solid @fl-body-bg;
|
||||
color: @fl-body-control-color;
|
||||
}
|
||||
& td, & th, & .yesno-cell .yesno {
|
||||
& td, & th, & .yesno {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
& thead {
|
||||
|
@ -47,14 +47,21 @@
|
|||
}
|
||||
}
|
||||
& .yesno-cell {
|
||||
padding: 0;
|
||||
}
|
||||
& .yesno-control {
|
||||
display: block;
|
||||
}
|
||||
& .yesno {
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
|
||||
&:not(.disabled) {
|
||||
&:hover, &.highlighted {
|
||||
background: darken(@fl-body-control-bg, 4%);
|
||||
}
|
||||
}
|
||||
}
|
||||
& .toggle-group {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<tr>
|
||||
<td class="toggle-group" {{action "toggleType" row.type}}>{{row.label}}</td>
|
||||
{{#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}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user