Renaming option bugs out when empty
This commit is contained in:
@@ -942,6 +942,9 @@ Option.Choice = new Class({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(mtches.length == 0 && value != '')
|
||||||
|
mtches.include(value);
|
||||||
|
|
||||||
mtches.each(self.addTag.bind(self));
|
mtches.each(self.addTag.bind(self));
|
||||||
|
|
||||||
self.addLastTag();
|
self.addLastTag();
|
||||||
@@ -963,7 +966,7 @@ Option.Choice = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
addLastTag: function(){
|
addLastTag: function(){
|
||||||
if(this.tag_input.getElement('li.choice:last-child'))
|
if(this.tag_input.getElement('li.choice:last-child') || !this.tag_input.getElement('li'))
|
||||||
this.addTag('');
|
this.addTag('');
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1151,7 +1154,7 @@ Option.Choice.Tag = new Class({
|
|||||||
|
|
||||||
var temp_input = new Element('input', {
|
var temp_input = new Element('input', {
|
||||||
'events': {
|
'events': {
|
||||||
'keyup': function(e){
|
'keydown': function(e){
|
||||||
e.stop();
|
e.stop();
|
||||||
|
|
||||||
if(e.key == 'right'){
|
if(e.key == 'right'){
|
||||||
@@ -1165,6 +1168,7 @@ Option.Choice.Tag = new Class({
|
|||||||
else if (e.key == 'backspace'){
|
else if (e.key == 'backspace'){
|
||||||
self.del();
|
self.del();
|
||||||
this.destroy();
|
this.destroy();
|
||||||
|
self.fireEvent('goLeft');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -332,15 +332,16 @@
|
|||||||
|
|
||||||
.page .tag_input > ul {
|
.page .tag_input > ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
line-height: 20px;
|
|
||||||
padding: 3px 0;
|
padding: 3px 0;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
width: 31%;
|
width: 30%;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
|
height: 27px;
|
||||||
|
line-height: 0;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.page .tag_input:hover > ul {
|
.page .tag_input:hover > ul {
|
||||||
width: 50%;
|
|
||||||
border-radius: 3px 0 0 3px;
|
border-radius: 3px 0 0 3px;
|
||||||
}
|
}
|
||||||
.page .tag_input:hover .formHint { display: none; }
|
.page .tag_input:hover .formHint { display: none; }
|
||||||
@@ -354,6 +355,7 @@
|
|||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
background: 0;
|
background: 0;
|
||||||
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
.page .tag_input > ul > li:first-child { min-width: 4px; }
|
.page .tag_input > ul > li:first-child { min-width: 4px; }
|
||||||
.page .tag_input li.choice {
|
.page .tag_input li.choice {
|
||||||
|
|||||||
Reference in New Issue
Block a user