this.addButton({
icon: 'e/insert_edit_link',
callback: this._displayDialogue,
- tags: 'a'
+ tags: 'a',
+ tagMatchRequiresAll: false
});
// And then the unlink button.
title: 'unlink',
// Watch the following tags and add/remove highlighting as appropriate:
- tags: 'a'
+ tags: 'a',
+ tagMatchRequiresAll: false
});
},
* If multiple key bindings are supplied to config.keys, then only the first is used.
* If set to false, then no description is added to the title.
* @param {string} [config.tags] The tags that trigger this button to be highlighted.
- * @param {boolean} [config.tagMatchRequiresAll=false] Working in combination with the tags parameter, highlight
- * this button when any match is good enough.
- *
+ * @param {boolean} [config.tagMatchRequiresAll=true] Working in combination with the tags parameter, when true
+ * every tag of the selection has to match. When false, only one match is needed. Only set this to false when
+ * necessary as it is much less efficient.
* See {{#crossLink "M.editor_atto.EditorSelection/selectionFilterMatches:method"}}{{/crossLink}} for more information.
* @param {string} [config.title=this.name] The string identifier in the plugin's language file.
* @param {string} [config.buttonName=this.name] The name of the button. This is used in the buttons object, and if
// Handle highlighting of the button.
if (config.tags) {
- var tagMatchRequiresAll = false;
+ var tagMatchRequiresAll = true;
if (typeof config.tagMatchRequiresAll === 'boolean') {
tagMatchRequiresAll = config.tagMatchRequiresAll;
}