John Cowen e4e85a8f83
ui: Move control of login modal to use JS rather than HTML (label/id) (#9883)
* Add before and after skip links portals

* Move EmptyState and ErrorState to use a @login action/function

* Move page title setting to the Route component

* Add Routes and Outlets everywhere, and use those to access login modal

* Add some aria-labels to the modals

* Docs

* Remove the label/input now we no longer need it, fixup pageobject

* Add basic modal docs

* Switch out old toggle names for ids

* Wrap nspace Route template in a Route component

* type > class
2021-04-06 13:40:40 +01:00

26 lines
638 B
JavaScript

import Component from '@ember/component';
import Slotted from 'block-slots';
import A11yDialog from 'a11y-dialog';
export default Component.extend(Slotted, {
tagName: '',
onclose: function() {},
onopen: function() {},
actions: {
connect: function($el) {
this.dialog = new A11yDialog($el);
this.dialog.on('hide', () => this.onclose({ target: $el }));
this.dialog.on('show', () => this.onopen({ target: $el }));
},
disconnect: function($el) {
this.dialog.destroy();
},
open: function() {
this.dialog.show();
},
close: function() {
this.dialog.hide();
},
},
});