mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix size of context sidebar refresh toggle buttons
This commit is contained in:
parent
2f33575907
commit
103e212aee
@ -46,8 +46,10 @@
|
||||
this.element.on("focus", function() {
|
||||
that.button.focus();
|
||||
});
|
||||
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"><span></span></button>');
|
||||
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"></button>');
|
||||
if (enabledLabel || disabledLabel) {
|
||||
this.buttonLabel = $("<span>").appendTo(this.button);
|
||||
}
|
||||
|
||||
if (this.options.class) {
|
||||
this.button.addClass(this.options.class)
|
||||
@ -63,14 +65,18 @@
|
||||
if (this.buttonIcon) {
|
||||
this.buttonIcon.addClass(enabledIcon);
|
||||
}
|
||||
if (this.buttonLabel) {
|
||||
this.buttonLabel.text(enabledLabel);
|
||||
}
|
||||
var width = this.button.width();
|
||||
this.button.removeClass("selected");
|
||||
if (this.buttonIcon) {
|
||||
this.buttonIcon.removeClass(enabledIcon);
|
||||
that.buttonIcon.addClass(disabledIcon);
|
||||
}
|
||||
if (this.buttonLabel) {
|
||||
that.buttonLabel.text(disabledLabel);
|
||||
}
|
||||
width = Math.max(width,this.button.width());
|
||||
if (this.buttonIcon) {
|
||||
this.buttonIcon.removeClass(disabledIcon);
|
||||
@ -99,7 +105,9 @@
|
||||
that.buttonIcon.addClass(enabledIcon);
|
||||
that.buttonIcon.removeClass(disabledIcon);
|
||||
}
|
||||
if (that.buttonLabel) {
|
||||
that.buttonLabel.text(enabledLabel);
|
||||
}
|
||||
} else {
|
||||
that.button.removeClass("selected");
|
||||
that.state = false;
|
||||
@ -107,8 +115,10 @@
|
||||
that.buttonIcon.addClass(disabledIcon);
|
||||
that.buttonIcon.removeClass(enabledIcon);
|
||||
}
|
||||
if (that.buttonLabel) {
|
||||
that.buttonLabel.text(disabledLabel);
|
||||
}
|
||||
}
|
||||
})
|
||||
this.element.trigger("change");
|
||||
}
|
||||
|
@ -39,6 +39,13 @@
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
button.red-ui-toggleButton.toggle {
|
||||
text-align: center;
|
||||
i {
|
||||
min-width: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.red-ui-sidebar-context-property {
|
||||
|
Loading…
Reference in New Issue
Block a user