1
0
mirror of synced 2024-11-22 21:16:10 +03:00

Fix automatically hiding the placeholder

The placeholder will not only be automatically hidden if the
results adapter was not already overridden. This will allow users
to override the results adapter to now hide the placeholder, if
they do not want that functionality.
This commit is contained in:
Kevin Brown 2014-11-01 17:27:30 -04:00
parent e57e0b1870
commit b87a4a55e4
7 changed files with 37 additions and 27 deletions

View File

@ -1496,6 +1496,13 @@ define('select2/defaults',[
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}
if (options.dropdownAdapter == null) {
@ -1517,11 +1524,6 @@ define('select2/defaults',[
options.selectionAdapter,
Placeholder
);
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}

View File

@ -1496,6 +1496,13 @@ define('select2/defaults',[
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}
if (options.dropdownAdapter == null) {
@ -1517,11 +1524,6 @@ define('select2/defaults',[
options.selectionAdapter,
Placeholder
);
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}

View File

@ -11031,6 +11031,13 @@ define('select2/defaults',[
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}
if (options.dropdownAdapter == null) {
@ -11052,11 +11059,6 @@ define('select2/defaults',[
options.selectionAdapter,
Placeholder
);
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}

File diff suppressed because one or more lines are too long

12
dist/js/select2.js vendored
View File

@ -1924,6 +1924,13 @@ define('select2/defaults',[
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}
if (options.dropdownAdapter == null) {
@ -1945,11 +1952,6 @@ define('select2/defaults',[
options.selectionAdapter,
Placeholder
);
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}

File diff suppressed because one or more lines are too long

View File

@ -48,6 +48,13 @@ define([
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}
if (options.dropdownAdapter == null) {
@ -69,11 +76,6 @@ define([
options.selectionAdapter,
Placeholder
);
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
}