mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 06:56:54 +08:00
Merge pull request #343 from ZmagoD/zd_SCI_780
fixed step description links [fixes SCI-780]
This commit is contained in:
commit
daee14bed5
2 changed files with 16 additions and 0 deletions
|
@ -80,6 +80,7 @@ function applyCancelCallBack() {
|
|||
|
||||
setTimeout(function() {
|
||||
initStepsComments();
|
||||
openLinksInNewTab();
|
||||
}, 1000);
|
||||
|
||||
})
|
||||
|
@ -111,6 +112,7 @@ function applyEditCallBack() {
|
|||
$("#new-step-main-tab a").on("shown.bs.tab", function() {
|
||||
$("#step_name").focus();
|
||||
});
|
||||
openLinksInNewTab();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -181,6 +183,7 @@ function formCallback($form) {
|
|||
|
||||
setTimeout(function() {
|
||||
initStepsComments();
|
||||
openLinksInNewTab();
|
||||
}, 1000);
|
||||
return true;
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
//= require quill
|
||||
|
||||
|
||||
// Globally overwrite links handling in Quill rich text editor
|
||||
var Link = Quill.import('formats/link');
|
||||
Link.sanitize = function(url) {
|
||||
|
@ -8,3 +9,15 @@ Link.sanitize = function(url) {
|
|||
}
|
||||
return 'http://' + url;
|
||||
};
|
||||
|
||||
function openLinksInNewTab() {
|
||||
_.each($('.ql-editor a'), function(el) {
|
||||
if ($(el).attr('target') !== '_blank') {
|
||||
$(el).attr('target', '_blank');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
openLinksInNewTab();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue