Split node UI rework - WIP

This commit is contained in:
Nick O'Leary
2016-06-04 00:40:40 +01:00
parent 762eb07dd4
commit 9f8c32ce8f
5 changed files with 772 additions and 9 deletions

View File

@@ -150,7 +150,11 @@
this.typeField = $("<input>",{type:'hidden'}).appendTo(this.uiSelect);
}
this.selectTrigger = $('<a href="#"><i class="fa fa-sort-desc"></i></a>').prependTo(this.uiSelect);
this.selectTrigger = $('<a href="#"></a>').prependTo(this.uiSelect);
$('<i class="fa fa-sort-desc"></i>').appendTo(this.selectTrigger);
if (this.types.length === 1) {
this.selectTrigger.addClass("disabled");
}
this.selectLabel = $('<span></span>').appendTo(this.selectTrigger);
this.element.on('focus', function() {
@@ -162,11 +166,17 @@
this.element.on('change', function() {
that.validate();
})
this.selectTrigger.click(function(event) {
event.preventDefault();
that._showMenu(that.menu,that.selectTrigger);
});
if (this.types.length > 1) {
this.selectTrigger.click(function(event) {
event.preventDefault();
that._showMenu(that.menu,that.selectTrigger);
});
} else {
this.selectTrigger.click(function(event) {
event.preventDefault();
that.element.focus();
})
}
if (hasSubOptions) {

View File

@@ -57,21 +57,26 @@
margin-top: 1px;
vertical-align: middle;
}
&.disabled {
cursor: default;
i {
color: #bbb;
}
}
span {
display: inline-block;
height: 100%;
padding: 0 1px 0 5px;
}
&:hover {
&:not(.disabled):hover {
text-decoration: none;
background: $typedInput-button-background-hover;
}
&:focus {
text-decoration: none;
}
&:active {
&:not(.disabled):active {
background: $typedInput-button-background-active;
text-decoration: none;
}