This task is to remove CtaDrawer.events and make it a pass in option instead. This may require some changes to View.js like the recent border box changes. Add tests to make sure that passing the option has the same effect as the current class property.
We almost had a regression in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/476576/ due to an event defined inside the CtaDrawer class which appears to only live to support a link in Minerva in resources/skins.minerva.scripts/init.js
The code in Minerva looks like this:
```
var drawerOptions = {
progressiveButton: new Button( {
progressive: true,
label: mw.msg( 'mobile-frontend-editor-redlink-create' ),
href: $( this ).attr( 'href' )
} ).options,
closeAnchor: new Anchor( {
progressive: true,
label: mw.msg( 'mobile-frontend-editor-redlink-leave' ),
additionalClassNames: 'hide'
} ).options,
content: mw.msg( 'mobile-frontend-editor-redlink-explain' ),
actionAnchor: false
},
drawer = new CtaDrawer( drawerOptions );
```
= Acceptance criteria
[] CtaDrawer does not define any events
[] The code in Minerva has been updated to pass the hide event as a property
= Developer notes
== Update to View's
One possible solution would be to allow events to be passed as a property (and bound to this) by a change to Views' such as https://gerrit.wikimedia.org/r/468188
```
var drawerOptions = {
progressiveButton: new Button( {
progressive: true,
label: mw.msg( 'mobile-frontend-editor-redlink-create' ),
href: $( this ).attr( 'href' )
} ).options,
closeAnchor: new Anchor( {
progressive: true,
events: {
'click .hide': onHide
},
label: mw.msg( 'mobile-frontend-editor-redlink-leave' ),
additionalClassNames: 'hide'
} ).options,
content: mw.msg( 'mobile-frontend-editor-redlink-explain' ),
actionAnchor: false
},
drawer = new CtaDrawer( drawerOptions );
```
Another would be to extend the CtaDrawer class inside Minerva.
Any other options?