mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 00:15:12 +00:00
点击内容下的a跳转
富文本编辑器下, readonly则跳转
This commit is contained in:
@@ -613,12 +613,26 @@ $(function() {
|
|||||||
return preHeight < maxHeight ? preHeight : maxHeight;
|
return preHeight < maxHeight ? preHeight : maxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// markdown preview下的a不能点击
|
// 内容下的a点击, 跳转
|
||||||
$('#preview-contents, #editorContent').on('click', 'a', function(e) {
|
$('#editorContent').on('click', 'a', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (LEA.readOnly) {
|
||||||
|
var url = $(this).attr('href');
|
||||||
|
if (isOtherSiteUrl(url)) {
|
||||||
|
openExternal(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#preview-contents').on('click', 'a', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var url = $(this).attr('href');
|
||||||
|
if (isOtherSiteUrl(url)) {
|
||||||
|
openExternal(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// markdown编辑器paste
|
// markdown编辑器paste
|
||||||
$('#left-column').on('paste', function(e) {
|
$('#left-column').on('paste', function(e) {
|
||||||
pasteImage(e);
|
pasteImage(e);
|
||||||
|
@@ -1784,6 +1784,10 @@ function isURL(str_url) {
|
|||||||
return re.test(str_url);
|
return re.test(str_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isOtherSiteUrl(url) {
|
||||||
|
return url.indexOf('http://127.0.0.1') < 0 && isURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
function reloadApp() {
|
function reloadApp() {
|
||||||
onClose(function() {
|
onClose(function() {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
Reference in New Issue
Block a user