ui: fix production build only empty role modal (#5806)

Adds the ability for multiple components to use the same dom buffer
pull/5812/head
John Cowen 6 years ago committed by GitHub
parent 727fddcae3
commit 7e2c66ad12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,12 +11,17 @@ export default Service.extend(Evented, {
}, },
add: function(name, dom) { add: function(name, dom) {
this.trigger('add', dom); this.trigger('add', dom);
buffer[name] = dom; if (typeof buffer[name] === 'undefined') {
buffer[name] = [];
}
buffer[name].push(dom);
return dom; return dom;
}, },
remove: function(name) { remove: function(name) {
if (typeof buffer[name] !== 'undefined') { if (typeof buffer[name] !== 'undefined') {
buffer[name].remove(); buffer[name].forEach(function(item) {
item.remove();
});
delete buffer[name]; delete buffer[name];
} }
}, },

@ -8,7 +8,7 @@
{{/block-slot}} {{/block-slot}}
{{#block-slot 'body'}} {{#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}} {{#role-form form=form dc=dc}}
{{#block-slot 'policy'}} {{#block-slot 'policy'}}
@ -23,7 +23,7 @@
{{/block-slot}} {{/block-slot}}
{{/role-form}} {{/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}} {{policy-form data-test-policy-form name="role[policy]" form=policyForm dc=dc}}
{{/block-slot}} {{/block-slot}}

Loading…
Cancel
Save