Skip to content

Commit 41449f1

Browse files
author
A.J. May
committed
fix js errors, bump version, update license
1 parent 1f3e78f commit 41449f1

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

django_bootstrap_typeahead/migrations/__init__.py

Whitespace-only changes.

django_bootstrap_typeahead/static/js/bootstrap-typeahead.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
* Django typeahead fields.
44
*
55
* Made by A.J. May
6-
* Under Creative Commons Share-alike
6+
* MIT License
77
*/
88
;(function ( $, window, document, undefined ) {
99

1010
var pluginName = "djangoBootstrapTypeahead",
11-
defaults = {
12-
propertyName: "value"
13-
};
11+
defaults = {};
1412

1513
function Plugin ( element, options ) {
1614
this.element = element;
@@ -22,6 +20,8 @@
2220

2321
Plugin.prototype = {
2422
init: function () {
23+
var self = this;
24+
2525
// Hide original select element
2626
$( this.element ).hide();
2727

@@ -63,7 +63,7 @@
6363
// Preprocess Field on value change
6464
if ( !this._is_multi_select() ) {
6565
this.$typeahead.on('change', function () {
66-
this._preprocess_field();
66+
self._preprocess_field();
6767
});
6868
}
6969

@@ -95,6 +95,7 @@
9595
},
9696
_preprocess_field: function () {
9797
var $element = $( this.element ).val(null);
98+
$element.children( 'option' ).removeAttr('selected');
9899

99100
if ( this._is_multi_select() ) {
100101
this.$tags.children().each( function () {

setup.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
setup(
44
name="django-bootstrap-typeahead",
5-
version="1.1.2",
5+
version="1.1.3",
66
packages=find_packages(),
7-
install_requires=[
8-
'django>=1.6',
9-
],
107
author="A.J. May",
118
author_email="[email protected]",
12-
description="A typeahead django form input which accepts a queryset to populate the typeahead options.",
13-
license="Creative Commons Attribution-ShareAlike 4.0 International License",
9+
description="""A typeahead django form input which
10+
accepts a queryset to populate the typeahead options.""",
11+
license="MIT License",
1412
keywords="django bootstrap typeahead form widget input",
1513
url="http://thegoods.aj7may.com/django-bootstrap-typeahead",
1614
zip_safe=False,

0 commit comments

Comments
 (0)