Avoid to wrap element into div for InputCompletion
The div is only needed if it receive an input element otherwise the element can receive the dropdown class. This avoid to increase the DOM depth and keep the original display of the element.
This commit is contained in:
1 parent
6cfe22250b
commit
db5372477e
1 file changed
+7
-2
+7
-2
@@ -2937,8 +2937,13 @@
|
||||
|
||||
Sao.common.InputCompletion = Sao.class_(Object, {
|
||||
init: function(el, source, match_selected, format) {
|
||||
el.wrap('<div class="dropdown"/>');
|
||||
this.dropdown = el.parent();
|
||||
if (!el.is('input')) {
|
||||
el.addClass('dropdown');
|
||||
this.dropdown = el;
|
||||
} else {
|
||||
el.wrap('<div class="dropdown"/>');
|
||||
this.dropdown = el.parent();
|
||||
}
|
||||
this.input = el.find('input').add(el.filter('input')).first();
|
||||
// bootstrap requires an element with data-toggle
|
||||
jQuery('<span/>', {
|
||||
|
||||
Reference in new issue
Block a user