Skip to content

Fixed dburucu's implementation to fix Issue #155 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: 1.1-wip
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
dab9f5f
Tag 1.1.0
Mar 5, 2013
9e5600a
Remove "name" attribute from source element to stop the form passing …
rjackson Mar 15, 2013
9d75da3
Merge pull request #54 from RJacksonm1/master
danielfarrell Mar 15, 2013
2b656a2
Release 1.1.1
Mar 15, 2013
05ec87f
Set value of hidden input from select box during initialization.
guyc Mar 22, 2013
5f607ed
Changed initial value fix to more consise form
guyc Mar 22, 2013
ba280c2
Merge pull request #56 from guyc/master
danielfarrell Mar 23, 2013
5c1a044
Added missing tabindex from original element
mgrundkoetter Jun 22, 2013
c3a6cb8
Merge pull request #74 from ujamii/master
danielfarrell Jun 22, 2013
0901861
Increment version number
Jun 22, 2013
9160426
Update bootstrap-combobox.js
dudabone Jun 23, 2013
f94a30e
Merge pull request #77 from dudabone/master
danielfarrell Jun 24, 2013
0421f16
Increment version to 1.1.3
Jun 24, 2013
1b6a7c5
Per jQuery doc, .prop() should be used to check whether an option is …
xiaohwan Jul 23, 2013
c67e203
Set hidden field value if preselected, version 1.1.4
danielfarrell Jul 26, 2013
69dbdeb
Merge pull request #89 from xiaohwan/master
danielfarrell Aug 5, 2013
df9e809
made uglify compatible
kersten Apr 25, 2013
6779ede
No longer depend on bootstrap-typeahead
danielfarrell Oct 5, 2013
d089ad9
trigger original element shcnage event after hidden one
osbornm Oct 14, 2013
7f4724d
Merge pull request #104 from osbornm/master
danielfarrell Oct 14, 2013
2ad2820
Prevent dropdown from disappearing when mouse downed on scrollbar. (…
Feb 7, 2014
a3a545e
Update README to look for new maintainer
danielfarrell Mar 8, 2014
14cf0cc
Updates for bootstrap 3
thephw Apr 10, 2014
696ee45
Ignore .DS_Store
gjacobrobertson Apr 16, 2014
b0a943e
Graceful degradation for bootstrap 2
gjacobrobertson Apr 16, 2014
2fb999c
Cleaned up graceful degradation options
gjacobrobertson Apr 16, 2014
acc4791
Updated README.md with combobox options
gjacobrobertson Apr 16, 2014
7f20074
Merge pull request #128 from wiserstudios/master
thephw May 2, 2014
bc7846b
disabled state feature with tests. Based on
gjacobrobertson May 2, 2014
c18cf53
Merge pull request #129 from wiserstudios/master
thephw May 2, 2014
a3de45b
Fixes bug where inline comboboxes did not work with bootstrap 3.0 sty…
thephw May 13, 2014
34fa0b5
Added demo for bootstrap 3.0
thephw May 13, 2014
e9a37c0
Merge pull request #132 from wiserstudios/master
thephw May 13, 2014
13362e3
Merge pull request #131 from Guy--L/master
thephw May 13, 2014
5b7e14c
Updated readme, closes issue #117
thephw May 13, 2014
fae53c7
Merge pull request #133 from wiserstudios/master
thephw May 13, 2014
0c64a2f
Add disabled class on container for when the combobox is disabled
thephw May 14, 2014
1439778
Merge pull request #134 from wiserstudios/master
thephw May 14, 2014
d509dfc
Remove request for new maintainer
thephw May 14, 2014
43f370f
Merge pull request #135 from wiserstudios/master
thephw May 14, 2014
a111a8c
Update version number
thephw May 14, 2014
1436e73
Merge pull request #136 from wiserstudios/master
thephw May 14, 2014
1103e65
Issue #155
dburucu Jan 5, 2015
df500a3
Fixed bug if newOptionsAllowed was true
RLHawk1 Feb 23, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We had need of a combobox at work and after looking around at the available opti

## How to use it

The dependencies are the Bootstrap stylesheet(CSS or LESS) and also the typeahead javascript plugin. Include them and then the stylesheet(CSS or LESS) and javascript.
The dependencies are the Bootstrap stylesheet(CSS or LESS). Include it and then the stylesheet(CSS or LESS) and javascript.

Then just activate the plugin on a normal select box(suggest having a blank option first):

Expand All @@ -23,6 +23,37 @@ Then just activate the plugin on a normal select box(suggest having a blank opti
});
</script>

### Options

When activating the plugin, you may include an object containing options for the combobox

$('.combobox').combobox({bsVersion: '2'});

`menu`: Custom markup for the dropdown menu list element.

`item`: Custom markup for the dropdown menu list items.

`matcher`: Custom function with one `item` argument that compares the item to the input. Defaults to matching on the query being a substring of the item, case insenstive

`sorter`: Custom function that sorts a list `items` for display in the dropdown

`highlighter`: Custom function for highlighting an `item`. Defaults to bolding the query within a matched item

`template`: Custom function that returns markup for the combobox.

`bsVersion`: Version of bootstrap being used. This is used by the default `template` function to generate markup correctly. Defaults to '3'. Set to '2' for compatibility with Bootstrap 2

## Dependencies
Uses the latest 1.X version of jQuery and the latest 2.X or 3.X of bootstrap.

## Live Example

### Bootstrap 2.0 Version
http://dl.dropbox.com/u/21368/bootstrap-combobox/index.html

### Bootstrap 3.0 Version
http://bootstrap-combobox-test.herokuapp.com/

## License

Licensed under the Apache License, Version 2.0
118 changes: 5 additions & 113 deletions css/bootstrap-combobox.css
Original file line number Diff line number Diff line change
@@ -1,124 +1,19 @@
.combobox-container {
margin-bottom: 5px;
*zoom: 1;
}
.combobox-container:before,
.combobox-container:after {
display: table;
content: "";
}
.combobox-container:after {
clear: both;
}
.combobox-container input,
.combobox-container .uneditable-input {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.combobox-container input:focus,
.combobox-container .uneditable-input:focus {
position: relative;
z-index: 2;
}
.combobox-container .uneditable-input {
border-left-color: #ccc;
}
.combobox-container .add-on {
float: left;
display: inline-block;
width: auto;
min-width: 16px;
height: inherit !important;
margin-right: -1px;
padding: 4px 5px;
font-weight: normal;
color: #999999;
text-align: center;
text-shadow: 0 1px 0 #ffffff;
background-color: #f5f5f5;
border: 1px solid #ccc;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;

}
.combobox-container .active {
background-color: #a9dba9;
border-color: #46a546;
}
.combobox-container input,
.combobox-container .uneditable-input {
float: left;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.combobox-container .uneditable-input {
border-left-color: #eee;
border-right-color: #ccc;
}
.combobox-container .add-on {
margin-right: 0;
margin-left: -1px;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.combobox-container input:first-child {
*margin-left: -160px;
}
.combobox-container input:first-child + .add-on {
*margin-left: -21px;
}
.combobox-container select {
display: inline-block;
width: 0;
height: 0;
border: 0;
padding: 0;
margin: 0;
text-indent: -99999px;
*text-indent: 0;
}
.form-search .combobox-container,
.form-inline .combobox-container {
display: inline-block;
margin-bottom: 0;
vertical-align: top;
}
.form-search .combobox-container .add-on,
.form-inline .combobox-container .add-on {
vertical-align: middle;
}
.combobox-selected .combobox-clear {
display: inline-block;
.form-search .combobox-container .input-group-addon,
.form-inline .combobox-container .input-group-addon {
width: auto;
}
.combobox-selected .caret {
display: none;
}
.combobox-clear {
/* :not doesn't work in IE8 */
.combobox-container:not(.combobox-selected) .glyphicon-remove {
display: none;
width: 14px;
height: 14px;
line-height: 14px;
vertical-align: top;
opacity: 0.3;
filter: alpha(opacity=30);
}
.dropdown:hover .combobox-clear,
.open.dropdown .combobox-clear {
opacity: 1;
filter: alpha(opacity=100);
}
.btn .combobox-clear {
margin-top: 1px;
margin-left: 1px;
}
.btn:hover .combobox-clear,
.open.btn-group .combobox-clear {
opacity: 1;
filter: alpha(opacity=100);
}
.typeahead-long {
max-height: 300px;
Expand All @@ -145,6 +40,3 @@
.control-group.success .combobox-container .caret {
border-top-color: #468847;
}
.btn .combobox-clear [class^="icon-"] {
line-height: 1.4em;
}
Loading