Commit 5db941ff authored by Andreas Gärtner's avatar Andreas Gärtner

Fix for Task #16378: Allow hyperlinks to open in new browser window.

parent a1448186
......@@ -87,14 +87,23 @@ Ext.define("ARSnova.controller.Application", {
cachedY = 0;
var preventClick = function (e) {
var prevent = false;
e = e || window.event;
var element = e.target || e.srcElement;
if (element.tagName === 'IMG' && element.className === 'resizeableImage' ||
element.tagName === 'SPAN' && element.className === 'videoImageContainer' ||
element.tagName === 'A' && element.className !== "session-export") {
return true;
element.tagName === 'A' && element.className !== 'session-export') {
prevent = true;
if (element.tagName === 'A' &&
!ARSnova.app.getController('Application').checkHrefProtocol(element.href)) {
element.target = '_blank'; // open link in new tab
prevent = false;
}
}
return false;
return prevent;
};
document.onclick = function (e) {
......@@ -156,10 +165,6 @@ Ext.define("ARSnova.controller.Application", {
controller.toggleHrefPanelActive();
controller.handleInternEmbeddedPageLoading(controller, title, url);
}
return false; // prevent default action and stop event propagation
} else {
element.target = '_blank'; // open link in new tab
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment