Skip to content

Commit 23235f2

Browse files
committed
fix #140,
also fix a bug which is caused by the PR #131 when static value option is used. just as the basic example
1 parent cfcb255 commit 23235f2

16 files changed

+419
-27
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nya-bootstrap-select",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"main": [
55
"dist/js/nya-bs-select.js",
66
"dist/css/nya-bs-select.css"

dist/css/nya-bs-select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* nya-bootstrap-select v2.1.6
2+
* nya-bootstrap-select v2.1.7
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/

dist/css/nya-bs-select.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/nya-bs-select.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* nya-bootstrap-select v2.1.6
2+
* nya-bootstrap-select v2.1.7
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/
@@ -508,9 +508,9 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
508508
dropdownToggle.addClass(className);
509509
}
510510

511-
if(className === 'form-control') {
512-
dropdownToggle.addClass(className);
513-
}
511+
// if(className === 'form-control') {
512+
// dropdownToggle.addClass(className);
513+
// }
514514
});
515515

516516
dropdownMenu.append(options);
@@ -1290,8 +1290,10 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
12901290
length = bsOptionElements.length,
12911291
optionTitle,
12921292
selection = [],
1293+
optionScopes = [],
12931294
match,
1294-
count;
1295+
count,
1296+
clone;
12951297

12961298
if(isMultiple && $attrs.selectedTextFormat === 'count') {
12971299
count = 1;
@@ -1328,6 +1330,7 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
13281330
selection.push(document.createTextNode(optionTitle));
13291331
} else {
13301332
selection.push(getOptionText(nyaBsOption));
1333+
optionScopes.push(nyaBsOption.data('isolateScope'))
13311334
}
13321335

13331336
}
@@ -1338,6 +1341,7 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
13381341
selection.push(document.createTextNode(optionTitle));
13391342
} else {
13401343
selection.push(getOptionText(nyaBsOption));
1344+
optionScopes.push(nyaBsOption.data('isolateScope'))
13411345
}
13421346
}
13431347
}
@@ -1352,12 +1356,23 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
13521356
dropdownToggle.removeClass('show-special-title');
13531357
// either single or multiple selection will show the only selected content.
13541358
filterOption.empty();
1355-
filterOption.append(selection[0]);
1359+
// the isolateScope attribute may not set when we use the static version nya-bs-option class with data-value attribute.
1360+
if(optionScopes[0]) {
1361+
clone = $compile (selection[0])(optionScopes[0]);
1362+
} else {
1363+
clone = selection[0];
1364+
}
1365+
filterOption.append(clone);
13561366
} else {
13571367
dropdownToggle.removeClass('show-special-title');
13581368
filterOption.empty();
13591369
for(index = 0; index < selection.length; index++) {
1360-
filterOption.append(selection[index]);
1370+
if(optionScopes[index]) {
1371+
clone = $compile (selection[index])(optionScopes[index]);
1372+
} else {
1373+
clone = selection[index];
1374+
}
1375+
filterOption.append(clone);
13611376
if(index < selection.length -1) {
13621377
filterOption.append(document.createTextNode(', '));
13631378
}

dist/js/nya-bs-select.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* nya-bootstrap-select v2.1.6
2+
* nya-bootstrap-select v2.1.7
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/

docs/dist/css/nya-bs-select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* nya-bootstrap-select v2.1.6
2+
* nya-bootstrap-select v2.1.7
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/
19.7 KB
Binary file not shown.

docs/dist/fonts/glyphicons-halflings-regular.svg

Lines changed: 288 additions & 0 deletions
Loading
44.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)