A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

How to register to VisualEditor sub component event?

Osnard

The ve.ui.MWSaveDialogAction emits the save event [1], providing a saveDeferred to the handler. As far as I understand this would give the handling code the possibility to cancel the save process as a result of some client side validation.
But how do I register to that event? I’d need to have the actual instance of the dialog.

[1] https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/ffaab335cee2d9a45cf6767fc40d3463f599b175/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js#L871-L878