mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-18 20:10:02 +00:00
Don't set draggable property for links
This commit is contained in:
parent
303f255fcd
commit
f3cab3753e
@ -25,8 +25,10 @@ exports.makeDraggable = function(options) {
|
|||||||
var dragImageType = options.dragImageType || "dom",
|
var dragImageType = options.dragImageType || "dom",
|
||||||
dragImage,
|
dragImage,
|
||||||
domNode = options.domNode;
|
domNode = options.domNode;
|
||||||
// Make the dom node draggable
|
// Make the dom node draggable (not necessary for anchor tags)
|
||||||
domNode.setAttribute("draggable","true");
|
if((domNode.tagName || "").toLowerCase() !== "a") {
|
||||||
|
domNode.setAttribute("draggable","true");
|
||||||
|
}
|
||||||
// Add event handlers
|
// Add event handlers
|
||||||
$tw.utils.addEventListeners(domNode,[
|
$tw.utils.addEventListeners(domNode,[
|
||||||
{name: "dragstart", handlerFunction: function(event) {
|
{name: "dragstart", handlerFunction: function(event) {
|
||||||
|
@ -43,7 +43,7 @@ describe("WikiText tests", function() {
|
|||||||
expect(wiki.renderTiddler("text/html","TiddlerThree")).toBe("<p>The speed of sound</p><p>The light of speed</p>");
|
expect(wiki.renderTiddler("text/html","TiddlerThree")).toBe("<p>The speed of sound</p><p>The light of speed</p>");
|
||||||
});
|
});
|
||||||
it("should support attributes specified as macro invocations", function() {
|
it("should support attributes specified as macro invocations", function() {
|
||||||
expect(wiki.renderTiddler("text/html","TiddlerFour")).toBe("<p><a class=\"tc-tiddlylink tc-tiddlylink-missing\" draggable=\"true\" href=\"#This%20is%20my%20''amazingly''%20groovy%20macro!\">This is a link</a></p>");
|
expect(wiki.renderTiddler("text/html","TiddlerFour")).toBe("<p><a class=\"tc-tiddlylink tc-tiddlylink-missing\" href=\"#This%20is%20my%20''amazingly''%20groovy%20macro!\">This is a link</a></p>");
|
||||||
});
|
});
|
||||||
it("should identify wikiwords to automatically link", function() {
|
it("should identify wikiwords to automatically link", function() {
|
||||||
expect(wiki.renderText("text/html","text/vnd-tiddlywiki","No wikilinks here").indexOf("<a") !== -1).toBe(false);
|
expect(wiki.renderText("text/html","text/vnd-tiddlywiki","No wikilinks here").indexOf("<a") !== -1).toBe(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user