1
0
mirror of synced 2025-02-16 20:13:16 +03:00

fix placeholder problem. fixes #853

This commit is contained in:
Igor Vaynberg 2013-02-13 01:15:05 -08:00
parent 244ba1bb43
commit c081d0f00c

View File

@ -1473,14 +1473,6 @@ the specific language governing permissions and limitations under the Apache Lic
// abstract
getPlaceholder: function () {
// if a placeholder is specified on a select without the first empty option ignore it
if (this.select) {
if (this.select.find("option").first().text() !== "") {
return undefined;
}
}
return this.opts.element.attr("placeholder") ||
this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
this.opts.element.data("placeholder") ||
@ -1807,6 +1799,18 @@ the specific language governing permissions and limitations under the Apache Lic
return opts;
},
// single
getPlaceholder: function() {
// if a placeholder is specified on a single select without the first empty option ignore it
if (this.select) {
if (this.select.find("option").first().text() !== "") {
return undefined;
}
}
return this.parent.getPlaceholder.apply(this, arguments);
},
// single
setPlaceholder: function () {
var placeholder = this.getPlaceholder();