Support hover callback in links

This commit is contained in:
Daniel Imms
2017-09-03 12:47:04 -07:00
parent 923ea7247c
commit b30cb58ff4
5 changed files with 38 additions and 15 deletions
+6 -6
View File
@@ -65,7 +65,6 @@ export class Linkifier {
* @param rows The array of rows to apply links to.
*/
public attachToDom(mouseZoneManager: IMouseZoneManager): void {
console.log('attachToDom', mouseZoneManager);
this._mouseZoneManager = mouseZoneManager;
}
@@ -147,6 +146,7 @@ export class Linkifier {
handler,
matchIndex: options.matchIndex,
validationCallback: options.validationCallback,
hoverCallback: options.hoverCallback,
priority: options.priority || 0
};
this._addLinkMatcherToList(matcher);
@@ -250,16 +250,16 @@ export class Linkifier {
x + 1,
x + 1 + uri.length,
y + 1,
e => {
if (matcher.hoverCallback) {
return matcher.hoverCallback(e, uri);
}
},
e => {
if (matcher.handler) {
return matcher.handler(e, uri);
}
window.open(uri, '_blink');
},
e => {
if (matcher.hoverCallback) {
return matcher.hoverCallback(e, uri);
}
}
));
}