mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Merge "Switch numbered link context to "delete" instead of "clear""
This commit is contained in:
commit
648457ca4c
|
@ -855,6 +855,7 @@
|
|||
"visualeditor-commentinspector-title",
|
||||
"visualeditor-commentinspector-tooltip",
|
||||
"visualeditor-content-select-all",
|
||||
"visualeditor-contextitemwidget-label-remove",
|
||||
"visualeditor-contextitemwidget-label-secondary",
|
||||
"visualeditor-dialog-action-apply",
|
||||
"visualeditor-dialog-action-cancel",
|
||||
|
|
|
@ -33,17 +33,15 @@ ve.ui.MWNumberedExternalLinkNodeContextItem.static.name = 'link/mwNumberedExtern
|
|||
|
||||
ve.ui.MWNumberedExternalLinkNodeContextItem.static.modelClasses = [ ve.dm.MWNumberedExternalLinkNode ];
|
||||
|
||||
ve.ui.MWNumberedExternalLinkNodeContextItem.static.clearable = false;
|
||||
|
||||
ve.ui.MWNumberedExternalLinkNodeContextItem.static.deletable = true;
|
||||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWNumberedExternalLinkNodeContextItem.prototype.onClearButtonClick = function () {
|
||||
// Getting around the inheritance chain a bit here... this is a subclass of attribute
|
||||
// context, but in practice it's a regular node context. So, for consistency with other
|
||||
// links we still want the "clear attribute" button, but we want it to behave like the
|
||||
// remove-the-node button.
|
||||
return this.onDeleteButtonClick();
|
||||
ve.ui.MWNumberedExternalLinkNodeContextItem.prototype.isDeletable = function () {
|
||||
// We don't care about whether the context wants to show delete buttons, so override the check.
|
||||
return this.constructor.static.deletable;
|
||||
};
|
||||
|
||||
/* Registration */
|
||||
|
|
Loading…
Reference in a new issue