mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
MWGalleryNode: Check node still exists when updating
Bug: T377717 Change-Id: I13f9c1ced3e59d4d88aaca02b884d06cc57b11a6
This commit is contained in:
parent
b62311a4dd
commit
332188807a
|
@ -67,6 +67,10 @@ ve.ce.MWGalleryNode.static.primaryCommandName = 'gallery';
|
|||
* Handle model update events.
|
||||
*/
|
||||
ve.ce.MWGalleryNode.prototype.onUpdate = function () {
|
||||
if ( !this.model ) {
|
||||
// onUpdate is debounced, so check the node still exists
|
||||
return;
|
||||
}
|
||||
const mwAttrs = this.model.getAttribute( 'mw' ).attrs;
|
||||
const defaults = mw.config.get( 'wgVisualEditorConfig' ).galleryOptions;
|
||||
const mode = mwAttrs.mode || defaults.mode;
|
||||
|
|
Loading…
Reference in a new issue