diff --git a/core/modules/widgets/link.js b/core/modules/widgets/link.js index f46349a2c..ab1fd6537 100755 --- a/core/modules/widgets/link.js +++ b/core/modules/widgets/link.js @@ -64,7 +64,7 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) { var domNode = this.document.createElement(tag); // Assign classes var classes = []; - if(this.enforceClasses === undefined) { + if(this.overrideClasses === undefined) classes.push("tc-tiddlylink"); if(this.isShadow) { classes.push("tc-tiddlylink-shadow"); @@ -77,9 +77,8 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) { } } classes.push(this.linkClasses); - } - else if (this.enforceClasses !== "") { - classes.push(this.enforceClasses); + } else if(this.overrideClasses !== "") + classes.push(this.overrideClasses) } if(classes.length > 0) { domNode.setAttribute("class",classes.join(" ")); @@ -174,7 +173,7 @@ LinkWidget.prototype.execute = function() { this.tooltip = this.getAttribute("tooltip"); this["aria-label"] = this.getAttribute("aria-label"); this.linkClasses = this.getAttribute("class"); - this.enforceClasses = this.getAttribute("setClass");; + this.overrideClasses = this.getAttribute("overrideClass"); this.tabIndex = this.getAttribute("tabindex"); this.draggable = this.getAttribute("draggable","yes"); this.linkTag = this.getAttribute("tag","a"); diff --git a/editions/tw5.com/tiddlers/widgets/LinkWidget.tid b/editions/tw5.com/tiddlers/widgets/LinkWidget.tid index 882584ebb..b704d77b1 100644 --- a/editions/tw5.com/tiddlers/widgets/LinkWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/LinkWidget.tid @@ -16,8 +16,8 @@ The `link` widget generates links to tiddlers. (Use the HTML `` element to ge |tabindex |Optional numeric [[tabindex|https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/tabIndex]] | |draggable |"yes" to enable the link to be draggable (defaults to "yes") | |tag |Optional tag to override the default "a" element | -|class|Optional css classes __in addition to__ the default classes (see below)| -|setClass|Optional css classes __instead of__ the default classes <<.from-version "5.1.16">>| +|class|Optional CSS classes //in addition to// the default classes (see below)| +|overrideClass|<<.from-version "5.1.16">> Optional CSS classes //instead of// the default classes | The content of the link widget is rendered within the `` tag. The draggable functionality is equivalent to using the DraggableWidget with the ''tiddler'' attribute set to the link target. @@ -64,11 +64,11 @@ The link widget automatically determines and applies the following classes to li * `tc-tiddlylink-missing` - applied to tiddler links where the target tiddler doesn't exist * `tc-tiddlylink-resolves` - applied to tiddler links when the target tiddler does exist -Use the `class` attribute to specify additional css classes, or `setClass` to apply only that but not the above defaults, e.g. when used in a LinkCatcherWidget: +Use the `class` attribute to specify additional css classes, or `overrideClass` to apply only that but not the above defaults, e.g. when used in a LinkCatcherWidget: <Here the `example` class is added. -*<$link setClass="example">Here only the `example` class applies. -*<$link setClass="">Here no class is set.""">> +*<$link overrideClass="example">Here only the `example` class applies. +*<$link overrideClass="">Here no class is set.""">> ! `href` generation