Add link support

This commit is contained in:
yflory
2020-03-10 17:38:49 +01:00
parent f316c6b85a
commit 8bc8a6b08f
2 changed files with 17 additions and 0 deletions

View File

@@ -57,6 +57,7 @@
list: []
},
getAvatar: function () {},
openLink: function () {},
getTextColor: function () { return '#000'; },
cursors: {},
tags: [],
@@ -395,6 +396,12 @@
var html = self.renderMd(element.body);
var nodeBody = document.createElement('div');
nodeBody.classList.add('kanban-item-body');
$(nodeBody).on('click', 'a', function (e) {
e.preventDefault();
var a = e.target;
if (!a.href) { return; }
self.options.openLink(a.href);
});
nodeBody.onclick = function (e) {
e.preventDefault();
};