Insert deselect UI on initial load if a value is selected.
This commit is contained in:
parent
fec3d3aafb
commit
b7a9b218fb
|
@ -269,6 +269,9 @@
|
||||||
this.choice_build(data);
|
this.choice_build(data);
|
||||||
} else if (data.selected && !this.is_multiple) {
|
} else if (data.selected && !this.is_multiple) {
|
||||||
this.selected_item.find("span").text(data.text);
|
this.selected_item.find("span").text(data.text);
|
||||||
|
if (this.allow_single_deselect) {
|
||||||
|
this.selected_item.find("span").first().after("<abbr></abbr>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -255,6 +255,11 @@
|
||||||
this.choice_build(data);
|
this.choice_build(data);
|
||||||
} else if (data.selected && !this.is_multiple) {
|
} else if (data.selected && !this.is_multiple) {
|
||||||
this.selected_item.down("span").update(data.html);
|
this.selected_item.down("span").update(data.html);
|
||||||
|
if (this.allow_single_deselect) {
|
||||||
|
this.selected_item.down("span").insert({
|
||||||
|
after: "<abbr></abbr>"
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -212,6 +212,7 @@ class Chosen
|
||||||
this.choice_build data
|
this.choice_build data
|
||||||
else if data.selected and not @is_multiple
|
else if data.selected and not @is_multiple
|
||||||
@selected_item.find("span").text data.text
|
@selected_item.find("span").text data.text
|
||||||
|
@selected_item.find("span").first().after "<abbr></abbr>" if @allow_single_deselect
|
||||||
|
|
||||||
this.search_field_disabled()
|
this.search_field_disabled()
|
||||||
this.show_search_field_default()
|
this.show_search_field_default()
|
||||||
|
|
|
@ -206,6 +206,7 @@ class Chosen
|
||||||
this.choice_build data
|
this.choice_build data
|
||||||
else if data.selected and not @is_multiple
|
else if data.selected and not @is_multiple
|
||||||
@selected_item.down("span").update( data.html )
|
@selected_item.down("span").update( data.html )
|
||||||
|
@selected_item.down("span").insert { after: "<abbr></abbr>" } if @allow_single_deselect
|
||||||
|
|
||||||
this.search_field_disabled()
|
this.search_field_disabled()
|
||||||
this.show_search_field_default()
|
this.show_search_field_default()
|
||||||
|
|
Loading…
Reference in a new issue