Skip to content

Commit

Permalink
Append to the input parent by default
Browse files Browse the repository at this point in the history
  • Loading branch information
indrimuska committed Jun 22, 2016
1 parent b78e109 commit a4af0f7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ $('#editable-select').editableSelect({ duration: 200 });

### appendTo

String or jQuery element. Default: 'body'
String or jQuery element. Default: `select.parent()`

Where to append the dropdown list.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-editable-select",
"version": "1.0.0",
"version": "1.0.1",
"authors": [
"Indri Muska <[email protected]>"
],
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery-editable-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
});
$.fn.editableSelect = function (options) {
var defaults = { filter: true, effect: 'default', duration: 'fast', appendTo: 'body', onCreate: null, onShow: null, onHide: null, onSelect: null };
var defaults = { filter: true, effect: 'default', duration: 'fast', onCreate: null, onShow: null, onHide: null, onSelect: null };
var select = this.clone(), input = $('<input type="text">'), list = $('<ul class="es-list">');
options = $.extend({}, defaults, options);
switch (options.effects) {
Expand All @@ -26,7 +26,7 @@
var es = this;
es.copyAttributes(select, input);
input.addClass('es-input');
list.appendTo(options.appendTo);
list.appendTo(options.appendTo || input.parent());
select.find('option').each(function () {
var li = $('<li>'), option = $(this);
li.data('value', option.val());
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery-editable-select.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/jquery-editable-select.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-editable-select",
"version": "1.0.0",
"version": "1.0.1",
"description": "A simple jQuery Plugin that converts a select into an text field with suggestions.",
"main": "dist/jquery-editable-select.min.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/jquery-editable-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
});
$.fn.editableSelect = function (options) {
var defaults = { filter: true, effect: 'default', duration: 'fast', appendTo: 'body', onCreate: null, onShow: null, onHide: null, onSelect: null };
var defaults = { filter: true, effect: 'default', duration: 'fast', onCreate: null, onShow: null, onHide: null, onSelect: null };
var select = this.clone(), input = $('<input type="text">'), list = $('<ul class="es-list">');
options = $.extend({}, defaults, options);
switch (options.effects) {
Expand All @@ -26,7 +26,7 @@
var es = this;
es.copyAttributes(select, input);
input.addClass('es-input');
list.appendTo(options.appendTo);
list.appendTo(options.appendTo || input.parent());
select.find('option').each(function () {
var li = $('<li>'), option = $(this);
li.data('value', option.val());
Expand Down

0 comments on commit a4af0f7

Please sign in to comment.