Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTypesCodes committed Jun 4, 2015
2 parents ca1d13a + e5a1e88 commit a2afd59
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"url": "https://github.com/angular-ui/bootstrap.git"
},
"devDependencies": {
"angular": "^1.3.15",
"angular-mocks": "^1.3.15",
"angular": "<=1.3.x",
"angular-mocks": "<=1.3.x",
"grunt": "^0.4.5",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/carousel/docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ angular.module('ui.bootstrap.demo').controller('CarouselDemoCtrl', function ($sc
$scope.addSlide = function() {
var newWidth = 600 + slides.length + 1;
slides.push({
image: 'http://placekitten.com/' + newWidth + '/300',
image: '//placekitten.com/' + newWidth + '/300',
text: ['More','Extra','Lots of','Surplus'][slides.length % 4] + ' ' +
['Cats', 'Kittys', 'Felines', 'Cutes'][slides.length % 4]
});
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ function ($compile, $parse, $document, $position, dateFilter, dateParser, datepi
if ( key === 'datepickerMode' ) {
var setAttribute = getAttribute.assign;
scope.$watch('watchData.' + key, function(value, oldvalue) {
if ( value !== oldvalue ) {
if ( angular.isFunction(setAttribute) && value !== oldvalue ) {
setAttribute(scope.$parent, value);
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/dropdown/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ By default the dropdown will automatically close if any of its elements is click

* `always` - (Default) automatically closes the dropdown when any of its elements is clicked.
* `outsideClick` - closes the dropdown automatically only when the user clicks any element outside the dropdown.
* `disabled` - disables the auto close. You can then control the open/close status of the dropdown manually, by using `is-open`. Please notice that the dropdown will still close if the toggle is clicked, the `esc` key is pressed or another dropdown is open.

* `disabled` - disables the auto close. You can then control the open/close status of the dropdown manually, by using `is-open`. Please notice that the dropdown will still close if the toggle is clicked, the `esc` key is pressed or another dropdown is open. The dropdown will no longer close on `$locationChangeSuccess` events.
4 changes: 3 additions & 1 deletion src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
});

$scope.$on('$locationChangeSuccess', function() {
scope.isOpen = false;
if (scope.getAutoClose() !== 'disabled') {
scope.isOpen = false;
}
});

$scope.$on('$destroy', function() {
Expand Down
10 changes: 10 additions & 0 deletions src/dropdown/test/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,5 +432,15 @@ describe('dropdownToggle', function() {
expect(elm1.hasClass(dropdownConfig.openClass)).toBe(false);
expect(elm2.hasClass(dropdownConfig.openClass)).toBe(true);
});

it('should not close on $locationChangeSuccess if auto-close="disabled"', function () {
var elm1 = dropdown('disabled');
expect(elm1.hasClass(dropdownConfig.openClass)).toBe(false);
clickDropdownToggle(elm1);
expect(elm1.hasClass(dropdownConfig.openClass)).toBe(true);
$rootScope.$broadcast('$locationChangeSuccess');
$rootScope.$digest();
expect(elm1.hasClass(dropdownConfig.openClass)).toBe(true);
});
});
});
6 changes: 3 additions & 3 deletions src/tooltip/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ There are three versions of the tooltip: `tooltip`, `tooltip-template`, and
- `tooltip` takes text only and will escape any HTML provided.
- `tooltip-template` takes text that specifies the location of a template to
use for the tooltip.
- `tooltip-html-unsafe` takes
whatever HTML is provided and displays it in a tooltip; it's called "unsafe"
because the HTML is not sanitized. *The user is responsible for ensuring the
- `tooltip-html` takes
whatever HTML is provided and displays it in a tooltip; *The user is responsible for ensuring the
content is safe to put into the DOM!*
- `tooltip-html-unsafe` -- deprecated in favour of `tooltip-html`

The tooltip directives provide several optional attributes to control how they
will display:
Expand Down
4 changes: 2 additions & 2 deletions src/typeahead/docs/demo.js

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

0 comments on commit a2afd59

Please sign in to comment.