mirror of https://github.com/status-im/consul.git
ui: fix production build only empty role modal (#5806)
Adds the ability for multiple components to use the same dom buffer
This commit is contained in:
parent
727fddcae3
commit
7e2c66ad12
|
@ -11,12 +11,17 @@ export default Service.extend(Evented, {
|
|||
},
|
||||
add: function(name, dom) {
|
||||
this.trigger('add', dom);
|
||||
buffer[name] = dom;
|
||||
if (typeof buffer[name] === 'undefined') {
|
||||
buffer[name] = [];
|
||||
}
|
||||
buffer[name].push(dom);
|
||||
return dom;
|
||||
},
|
||||
remove: function(name) {
|
||||
if (typeof buffer[name] !== 'undefined') {
|
||||
buffer[name].remove();
|
||||
buffer[name].forEach(function(item) {
|
||||
item.remove();
|
||||
});
|
||||
delete buffer[name];
|
||||
}
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{/block-slot}}
|
||||
{{#block-slot 'body'}}
|
||||
|
||||
<input id="{{name}}_state_role" type="radio" name="{{name}}[state]" value="role" checked={{eq state 'role'}} onchange={{action 'change'}} />
|
||||
<input id="{{name}}_state_role" type="radio" name="{{name}}[state]" value="role" checked={{if (eq state 'role') 'checked'}} onchange={{action 'change'}} />
|
||||
{{#role-form form=form dc=dc}}
|
||||
{{#block-slot 'policy'}}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
{{/block-slot}}
|
||||
{{/role-form}}
|
||||
|
||||
<input id="{{name}}_state_policy" type="radio" name="{{name}}[state]" value="policy" checked={{eq state 'policy'}} onchange={{action 'change'}} />
|
||||
<input id="{{name}}_state_policy" type="radio" name="{{name}}[state]" value="policy" checked={{if (eq state 'policy') 'checked'}} onchange={{action 'change'}} />
|
||||
{{policy-form data-test-policy-form name="role[policy]" form=policyForm dc=dc}}
|
||||
|
||||
{{/block-slot}}
|
||||
|
|
Loading…
Reference in New Issue