mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-17 09:22:51 +00:00
remove empty class="" from button widget to simplify DOM
This commit is contained in:
parent
b4c369adc4
commit
a53c6b5e5c
@ -75,7 +75,7 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
domNode = this.document.createElement(tag);
|
domNode = this.document.createElement(tag);
|
||||||
this.domNode = domNode;
|
this.domNode = domNode;
|
||||||
// Assign classes
|
// Assign classes
|
||||||
var classes = this["class"].split(" ") || [],
|
var classes = (this["class"]) ? this["class"].split(" ") : [],
|
||||||
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
|
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
|
||||||
if(this.selectedClass) {
|
if(this.selectedClass) {
|
||||||
if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
|
if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
|
||||||
@ -89,7 +89,9 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
if(isPoppedUp) {
|
if(isPoppedUp) {
|
||||||
$tw.utils.pushTop(classes,"tc-popup-handle");
|
$tw.utils.pushTop(classes,"tc-popup-handle");
|
||||||
}
|
}
|
||||||
domNode.className = classes.join(" ");
|
if(classes.length > 0) {
|
||||||
|
domNode.className = classes.join(" ");
|
||||||
|
}
|
||||||
// Assign data- attributes
|
// Assign data- attributes
|
||||||
this.assignAttributes(domNode,{
|
this.assignAttributes(domNode,{
|
||||||
sourcePrefix: "data-",
|
sourcePrefix: "data-",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user