Good day,
I am trying to disable link drag-ability through the draggable
attribute of the $link
widget, and doesn’t seem to behave as I expected it.
I would expect the widget’s draggable
attribute when set to no
to be rendered as a draggable="false"
attribute to the rendered HTML <a
tag, but that does not happen.
The link remains draggable as per this screen capture:
If however I force the "draggable=“false” attribute in the HTML tag using the browser’s developer tools, I get the desired behaviour (the link is not draggable):
The other preview modes (available via the Internals
plugin) suggest the widget attribute is parsed correctly:
My work-around has been to modify:$:/core/modules/widgets/link.js
by adding the else
statement below, but I am not clear on unintended consequences.
...
// Make the link draggable if required
if(this.draggable === "yes") {
$tw.utils.makeDraggable({
domNode: domNode,
dragTiddlerFn: function() {return self.to;},
widget: this
});
} else
domNode.setAttribute("draggable","false");
}
...
Any idea?