Skip to content

Commit

Permalink
Improved model controller properties update
Browse files Browse the repository at this point in the history
Closes #49
  • Loading branch information
indrimuska committed Jul 1, 2016
1 parent ab315ba commit 623f96a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-selector",
"version": "1.3.15",
"version": "1.3.16",
"authors": [
"Indri Muska <indrimuska@gmail.com>"
],
Expand Down
2 changes: 2 additions & 0 deletions dist/angular-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,13 @@
}
if (!scope.multiple || scope.closeAfterSelection) scope.close();
scope.resetInput();
selectCtrl.$setDirty();
};
scope.unset = function (index) {
if (!scope.multiple) scope.selectedValues = [];
else scope.selectedValues.splice(angular.isDefined(index) ? index : scope.selectedValues.length - 1, 1);
scope.resetInput();
selectCtrl.$setDirty();
};
scope.keydown = function (e) {
switch (e.keyCode) {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-selector.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-selector",
"version": "1.3.15",
"version": "1.3.16",
"description": "A native AngularJS directive that transform a simple `<select>` box into a full html select with typeahead.",
"main": "src/angular-selector.js",
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions src/angular-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,13 @@
}
if (!scope.multiple || scope.closeAfterSelection) scope.close();
scope.resetInput();
selectCtrl.$setDirty();
};
scope.unset = function (index) {
if (!scope.multiple) scope.selectedValues = [];
else scope.selectedValues.splice(angular.isDefined(index) ? index : scope.selectedValues.length - 1, 1);
scope.resetInput();
selectCtrl.$setDirty();
};
scope.keydown = function (e) {
switch (e.keyCode) {
Expand Down

0 comments on commit 623f96a

Please sign in to comment.