Skip to content

Commit

Permalink
update to 2.0.5, update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
lordfriend committed Dec 15, 2014
1 parent ffdc3c8 commit a7e33ca
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nya-bootstrap-select",
"version": "2.0.4",
"version": "2.0.5",
"main": [
"dist/js/nya-bs-select.js",
"dist/css/nya-bs-select.css"
Expand Down
2 changes: 1 addition & 1 deletion dist/css/nya-bs-select.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.4
* nya-bootstrap-select v2.0.5
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/nya-bs-select.min.css

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

13 changes: 10 additions & 3 deletions dist/js/nya-bs-select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.4
* nya-bootstrap-select v2.0.5
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down Expand Up @@ -1246,7 +1246,14 @@ nyaBsSelect.directive('nyaBsOption', ['$parse', function($parse){
// hasOwnProperty.
var lastBlockMap = createMap();

$scope.$watchCollection(collectionExp, function nyaBsOptionAction(collection) {
// deepWatch will impact performance. use with caution.
if($attr.deepWatch === 'true') {
$scope.$watch(collectionExp, nyaBsOptionAction, true);
} else {
$scope.$watchCollection(collectionExp, nyaBsOptionAction);
}

function nyaBsOptionAction(collection) {
var index,

previousNode = $element[0], // node that cloned nodes should be inserted after
Expand Down Expand Up @@ -1429,7 +1436,7 @@ nyaBsSelect.directive('nyaBsOption', ['$parse', function($parse){
lastBlockMap = nextBlockMap;

nyaBsSelectCtrl.onCollectionChange(values);
});
}
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/nya-bs-select.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/css/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.4
* nya-bootstrap-select v2.0.5
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down
7 changes: 6 additions & 1 deletion docs/dist/css/nya-bs-select.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.4
* nya-bootstrap-select v2.0.5
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down Expand Up @@ -179,6 +179,11 @@
.nya-bs-select .bs-searchbox input.form-control {
margin-bottom: 0;
width: 100%;
float: none;
z-index: inherit;
display: block;
position: static;
border-radius: 4px;
}
.nya-bs-select.fit-width .btn .filter-option {
position: static;
Expand Down
19 changes: 15 additions & 4 deletions docs/dist/js/nya-bs-select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* nya-bootstrap-select v2.0.4
* nya-bootstrap-select v2.0.5
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
Expand Down Expand Up @@ -390,7 +390,7 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', functio
// dropdownToggle.addClass(className);
//}

if(className = 'form-control') {
if(className === 'form-control') {
dropdownToggle.addClass(className);
}
});
Expand Down Expand Up @@ -586,6 +586,7 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', functio
searchBox.children().eq(0)[0].focus();
nyaBsOptionNode = findFocus(true);
if(nyaBsOptionNode) {
dropdownMenu.children().removeClass('active');
jqLite(nyaBsOptionNode).addClass('active');
}
} else if($element.hasClass('open')) {
Expand Down Expand Up @@ -736,6 +737,9 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', functio
// find the focusable node but we will use active
nyaBsOptionNode = findFocus(true);
if(nyaBsOptionNode) {
// remove previous active state
dropdownMenu.children().removeClass('active');
// set active to first focusable element
jqLite(nyaBsOptionNode).addClass('active');
}
} else {
Expand Down Expand Up @@ -1242,7 +1246,14 @@ nyaBsSelect.directive('nyaBsOption', ['$parse', function($parse){
// hasOwnProperty.
var lastBlockMap = createMap();

$scope.$watchCollection(collectionExp, function nyaBsOptionAction(collection) {
// deepWatch will impact performance. use with caution.
if($attr.deepWatch === 'true') {
$scope.$watch(collectionExp, nyaBsOptionAction, true);
} else {
$scope.$watchCollection(collectionExp, nyaBsOptionAction);
}

function nyaBsOptionAction(collection) {
var index,

previousNode = $element[0], // node that cloned nodes should be inserted after
Expand Down Expand Up @@ -1425,7 +1436,7 @@ nyaBsSelect.directive('nyaBsOption', ['$parse', function($parse){
lastBlockMap = nextBlockMap;

nyaBsSelectCtrl.onCollectionChange(values);
});
}
};
}
}
Expand Down
12 changes: 11 additions & 1 deletion docs/src/content/api/nya-bs-option.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ as attribute:
```html
<li
nya-bs-option=""
[value=""]>
[value=""]
[deep-watch=""]>
<a>
...
</a>
Expand Down Expand Up @@ -158,5 +159,14 @@ as attribute:
</p>
</td>
</tr>
<tr>
<td>deep-watch</td>
<td><span class="label label-primary">string</span></td>
<td>
When set to true, enable a deep watch to collection_expression. `nya-bs-option` will use $watch(exp, listener, true) to make a deep watch. Turn on this feature will impact the performance. even cause expection.
It is not recommended.
By default. `nya-bs-option` will use $watchCollection to watch the collection_expression.
</td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nya-bootstrap-select",
"version": "2.0.4",
"version": "2.0.5",
"description": "An angular directive wraps bootstrap-select",
"repository": {
"type": "git",
Expand Down

0 comments on commit a7e33ca

Please sign in to comment.