Add ILinkMatcherOptions.hoverEndCallback

This commit is contained in:
Daniel Imms
2017-09-06 16:05:09 -07:00
parent 66c891df5b
commit e960a0a82c
6 changed files with 44 additions and 13 deletions
+9 -3
View File
@@ -133,7 +133,8 @@ export class Linkifier {
handler,
matchIndex: options.matchIndex,
validationCallback: options.validationCallback,
hoverCallback: options.hoverCallback,
hoverStartCallback: options.hoverStartCallback,
hoverEndCallback: options.hoverEndCallback,
priority: options.priority || 0
};
this._addLinkMatcherToList(matcher);
@@ -259,8 +260,13 @@ export class Linkifier {
window.open(uri, '_blank');
},
e => {
if (matcher.hoverCallback) {
return matcher.hoverCallback(e, uri);
if (matcher.hoverStartCallback) {
matcher.hoverStartCallback(e, uri);
}
},
() => {
if (matcher.hoverEndCallback) {
matcher.hoverEndCallback();
}
}
));