Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])

/* direction: "prev" or "next" */
self.select = function(nextSlide, direction) {
var nextIndex = slides.indexOf(nextSlide);
var nextIndex = jQuery.inArray(nextSlide, slides);
//Decide direction if it's not given
if (direction === undefined) {
direction = nextIndex > currentIndex ? "next" : "prev";
Expand All @@ -38,8 +38,9 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
if (self.currentSlide && angular.isString(direction) && !$scope.noTransition && nextSlide.$element) {
//We shouldn't do class manip in here, but it's the same weird thing bootstrap does. need to fix sometime
nextSlide.$element.addClass(direction);
nextSlide.$element[0].offsetWidth = nextSlide.$element[0].offsetWidth; //force reflow

if (!$.browser.msie) { // offsetWidth not settable in IE
nextSlide.$element[0].offsetWidth = nextSlide.$element[0].offsetWidth; //force reflow
}
//Set all other slides to stop doing their stuff for the new transition
angular.forEach(slides, function(slide) {
angular.extend(slide, {direction: '', entering: false, leaving: false, active: false});
Expand Down Expand Up @@ -72,7 +73,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])

/* Allow outside people to call indexOf on slides array */
self.indexOfSlide = function(slide) {
return slides.indexOf(slide);
return jQuery.inArray(slide, slides);
};

$scope.next = function() {
Expand Down Expand Up @@ -152,7 +153,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])

self.removeSlide = function(slide) {
//get the index of the slide inside the carousel
var index = slides.indexOf(slide);
var index = jQuery.inArray(slide,slides);
slides.splice(index, 1);
if (slides.length > 0 && slide.active) {
if (index >= slides.length) {
Expand Down
4 changes: 2 additions & 2 deletions template/carousel/carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<li ng-repeat="slide in slides()" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>
</ol>
<div class="carousel-inner" ng-transclude></div>
<a ng-click="prev()" class="carousel-control left" ng-show="slides().length > 1">&lsaquo;</a>
<a ng-click="next()" class="carousel-control right" ng-show="slides().length > 1">&rsaquo;</a>
<a href="javascript:void(0);" ng-click="prev()" class="carousel-control left" ng-show="slides().length > 1">&lsaquo;</a>
<a href="javascript:void(0);" ng-click="next()" class="carousel-control right" ng-show="slides().length > 1">&rsaquo;</a>
</div>
2 changes: 1 addition & 1 deletion template/pagination/pagination.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="pagination"><ul>
<li ng-repeat="page in pages" ng-class="{active: page.active, disabled: page.disabled}"><a ng-click="selectPage(page.number)">{{page.text}}</a></li>
<li ng-repeat="page in pages" ng-class="{active: page.active, disabled: page.disabled}"><a href="javascript:void(0);" ng-click="selectPage(page.number)">{{page.text}}</a></li>
</ul>
</div>
2 changes: 1 addition & 1 deletion template/tabs/tab.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<li ng-class="{active: active, disabled: disabled}">
<a ng-click="select()" tab-heading-transclude>{{heading}}</a>
<a href="javascript:void(0);" ng-click="select()" tab-heading-transclude>{{heading}}</a>
</li>