Merge "Switch numbered link context to "delete" instead of "clear""

This commit is contained in:
jenkins-bot 2015-12-14 01:19:22 +00:00 committed by Gerrit Code Review
commit 648457ca4c
2 changed files with 8 additions and 9 deletions

View file

@ -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",

View file

@ -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 */