Opened 13 years ago
Closed 12 years ago
#28095 closed defect (bug) (fixed)
wpLink modal no longer triggers open event
| Reported by: | bradyvercher | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.0 |
| Component: | Editor | Version: | 3.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | javascript |
Description
With the move away from wpdialog in WP 3.9, the wpLink modal no longer triggers an 'open' event.
I was using that event in a plugin to allow users to automatically search using text that was selected in the editor (a similar feature was proposed and reverted in #16276).
Without the event, it's not possible to reliably determine when the wpLink modal is opened in order to interact with it. The attached patch adds a new event to maintain similar functionality with previous versions.
Attachments (2)
Change History (9)
This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.
12 years ago
#5
@
12 years ago
- Milestone 3.9.2 → 4.0
Sounds good. Maybe better if the event is fired on the document or fire triggerHandler (no propagation) on the wrapper?
open: function( editorId ) {
...
$( document ).trigger( 'wplink-open', inputs.wrap );
}
close: function() {
...
$( document ).trigger( 'wplink-close', inputs.wrap );
}
Any chance I can get someone to take a look at this for 4.0?