Fix #1172 -- Properly set width when allowClear is being used.
Signed-off-by: Igor Vaynberg <igor.vaynberg@gmail.com>
This commit is contained in:
parent
25549c787b
commit
8cb3698820
10
select2.css
10
select2.css
@ -81,6 +81,10 @@ Version: @@ver@@ Timestamp: @@timestamp@@
|
|||||||
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select2-container.select2-allowclear .select2-choice span {
|
||||||
|
margin-right: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
.select2-container .select2-choice span {
|
.select2-container .select2-choice span {
|
||||||
margin-right: 26px;
|
margin-right: 26px;
|
||||||
display: block;
|
display: block;
|
||||||
@ -94,11 +98,11 @@ Version: @@ver@@ Timestamp: @@timestamp@@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.select2-container .select2-choice abbr {
|
.select2-container .select2-choice abbr {
|
||||||
display: block;
|
display: inline-block;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 26px;
|
right: 24px;
|
||||||
top: 8px;
|
top: 8px;
|
||||||
|
|
||||||
font-size: 1px;
|
font-size: 1px;
|
||||||
@ -171,7 +175,7 @@ Version: @@ver@@ Timestamp: @@timestamp@@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.select2-container .select2-choice div {
|
.select2-container .select2-choice div {
|
||||||
display: block;
|
display: inline-block;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -1944,6 +1944,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
this.selection.addClass("select2-default");
|
this.selection.addClass("select2-default");
|
||||||
|
|
||||||
|
this.container.removeClass("select2-allowclear");
|
||||||
this.selection.find("abbr").hide();
|
this.selection.find("abbr").hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2022,6 +2023,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.selection.removeClass("select2-default");
|
this.selection.removeClass("select2-default");
|
||||||
|
|
||||||
if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
|
if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
|
||||||
|
this.container.addClass("select2-allowclear");
|
||||||
this.selection.find("abbr").show();
|
this.selection.find("abbr").show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user