From d3da8b78fdf83f1c633f468a24acdab3500bf54c Mon Sep 17 00:00:00 2001
From: Louis Sivillo
Date: Mon, 1 Jul 2013 09:34:52 -0400
Subject: [PATCH 0001/1719] fix(dialog): reintroduced dialogOpenClass option
This option represents class which is added to the body when the dialog is open.
It was present before in twitter bootstrap, then removed in 2.3.0,
but then recently reintroduced in 3.0
Closes #798
---
src/dialog/dialog.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/dialog/dialog.js b/src/dialog/dialog.js
index 0e0413963c..42d63f59e2 100644
--- a/src/dialog/dialog.js
+++ b/src/dialog/dialog.js
@@ -20,6 +20,7 @@ dialogModule.provider("$dialog", function(){
backdropClass: 'modal-backdrop',
transitionClass: 'fade',
triggerClass: 'in',
+ dialogOpenClass: 'modal-open',
resolve:{},
backdropFade: false,
dialogFade:false,
@@ -133,7 +134,7 @@ dialogModule.provider("$dialog", function(){
if(self.options.dialogFade){ self.modalEl.addClass(self.options.triggerClass); }
if(self.options.backdropFade){ self.backdropEl.addClass(self.options.triggerClass); }
});
-
+ body.addClass(defaults.dialogOpenClass);
self._bindEvents();
});
@@ -191,7 +192,7 @@ dialogModule.provider("$dialog", function(){
Dialog.prototype._onCloseComplete = function(result) {
this._removeElementsFromDom();
this._unbindEvents();
-
+ body.removeClass(defaults.dialogOpenClass);
this.deferred.resolve(result);
};
From d34f2de189d9a55562d2f0abf449f22042871cea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Micha=C5=82owski?=
Date: Tue, 13 Aug 2013 23:59:16 +0200
Subject: [PATCH 0002/1719] fix(carousel): correct reflow triggering on FFox
and Safari
---
src/carousel/carousel.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js
index b4681e80de..cb7d585173 100644
--- a/src/carousel/carousel.js
+++ b/src/carousel/carousel.js
@@ -1,7 +1,7 @@
/**
* @ngdoc overview
* @name ui.bootstrap.carousel
-*
+*
* @description
* AngularJS version of an image carousel.
*
@@ -32,10 +32,10 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
}
function goNext() {
//If we have a slide to transition from and we have a transition type and we're allowed, go
- if (self.currentSlide && angular.isString(direction) && !$scope.noTransition && nextSlide.$element) {
+ 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
+ var reflow = nextSlide.$element[0].offsetWidth; //force reflow
//Set all other slides to stop doing their stuff for the new transition
angular.forEach(slides, function(slide) {
@@ -74,7 +74,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
$scope.next = function() {
var newIndex = (currentIndex + 1) % slides.length;
-
+
//Prevent this user-triggered transition from occurring if there is already one in progress
if (!$scope.$currentTransition) {
return self.select(slides[newIndex], 'next');
@@ -83,7 +83,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
$scope.prev = function() {
var newIndex = currentIndex - 1 < 0 ? slides.length - 1 : currentIndex - 1;
-
+
//Prevent this user-triggered transition from occurring if there is already one in progress
if (!$scope.$currentTransition) {
return self.select(slides[newIndex], 'prev');
@@ -300,7 +300,7 @@ function CarouselDemoCtrl($scope) {
var lastValue = scope.active = getActive(scope.$parent);
scope.$watch(function parentActiveWatch() {
var parentActive = getActive(scope.$parent);
-
+
if (parentActive !== scope.active) {
// we are out of sync and need to copy
if (parentActive !== lastValue) {
From 366e0c8a1ff7fee8eb96e1c317a658957785f457 Mon Sep 17 00:00:00 2001
From: Pawel Kozlowski
Date: Thu, 15 Aug 2013 18:09:30 +0200
Subject: [PATCH 0003/1719] fix(typeahead): set validity flag for non-editable
inputs
Closes #806
---
src/typeahead/test/typeahead.spec.js | 19 ++++++++++++++++++-
src/typeahead/typeahead.js | 14 +++++++++++---
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js
index b1cee67618..e93d5e18b7 100644
--- a/src/typeahead/test/typeahead.spec.js
+++ b/src/typeahead/test/typeahead.spec.js
@@ -163,11 +163,28 @@ describe('typeahead tests', function () {
});
it('should support the editable property to limit model bindings to matches only', function () {
- var element = prepareInputEl("");
+ var element = prepareInputEl("
ng-model='result' typeahead='item for item in source | filter:$viewValue' typeahead-editable='false'>
");
changeInputValueTo(element, 'not in matches');
expect($scope.result).toEqual(undefined);
});
+ it('should set validation erros for non-editable inputs', function () {
+
+ var element = prepareInputEl(
+ "");
+
+ changeInputValueTo(element, 'not in matches');
+ expect($scope.result).toEqual(undefined);
+ expect($scope.form.input.$error.editable).toBeTruthy();
+
+ changeInputValueTo(element, 'foo');
+ triggerKeyDown(element, 13);
+ expect($scope.result).toEqual('foo');
+ expect($scope.form.input.$error.editable).toBeFalsy();
+ });
+
it('should bind loading indicator expression', inject(function ($timeout) {
$scope.isLoading = false;
diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js
index f03e7383bc..df55c8b2d4 100644
--- a/src/typeahead/typeahead.js
+++ b/src/typeahead/typeahead.js
@@ -29,7 +29,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
};
}])
- .directive('typeahead', ['$compile', '$parse', '$q', '$timeout', '$document', '$position', 'typeaheadParser', function ($compile, $parse, $q, $timeout, $document, $position, typeaheadParser) {
+ .directive('typeahead', ['$compile', '$parse', '$q', '$timeout', '$document', '$position', 'typeaheadParser',
+ function ($compile, $parse, $q, $timeout, $document, $position, typeaheadParser) {
var HOT_KEYS = [9, 13, 27, 38, 40];
@@ -158,7 +159,12 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
}
}
- return isEditable ? inputValue : undefined;
+ if (isEditable) {
+ return inputValue;
+ } else {
+ modelCtrl.$setValidity('editable', false);
+ return undefined;
+ }
});
modelCtrl.$formatters.push(function (modelValue) {
@@ -192,6 +198,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
locals[parserResult.itemName] = item = scope.matches[activeIdx].model;
model = parserResult.modelMapper(originalScope, locals);
$setModelValue(originalScope, model);
+ modelCtrl.$setValidity('editable', true);
onSelectCallback(originalScope, {
$item: item,
@@ -199,8 +206,9 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
$label: parserResult.viewMapper(originalScope, locals)
});
- //return focus to the input element if a mach was selected via a mouse click event
resetMatches();
+
+ //return focus to the input element if a mach was selected via a mouse click event
element[0].focus();
};
From 8620aedba99b05822311c4529a7877e6f62754d6 Mon Sep 17 00:00:00 2001
From: Pawel Kozlowski
Date: Thu, 15 Aug 2013 19:22:39 +0200
Subject: [PATCH 0004/1719] docs(all): add info about styling cursors for
tags
Closes #752
Closes #816
---
misc/demo/assets/demo.css | 5 +++++
misc/demo/index.html | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/misc/demo/assets/demo.css b/misc/demo/assets/demo.css
index ddad9986b5..8a3ee5c909 100644
--- a/misc/demo/assets/demo.css
+++ b/misc/demo/assets/demo.css
@@ -69,6 +69,11 @@ section {
border-top: 1px solid rgba(255,255,255,0.3);
border-bottom: 1px solid rgba(221,221,221,0.3);
}
+
+.nav, .pagination, .carousel a {
+ cursor: pointer;
+}
+
.bs-docs-social-buttons {
margin-left: 0;
margin-bottom: 0;
diff --git a/misc/demo/index.html b/misc/demo/index.html
index 7bdabb1ffe..c779e796f3 100644
--- a/misc/demo/index.html
+++ b/misc/demo/index.html
@@ -156,6 +156,17 @@
You can fork one of the plunkers from this page to see a working example of what is described here.
+
CSS
+
Original Bootstrap's CSS depends on empty href attributes to style cursors for several components (pagination, tabs etc.).
+ But in AngularJS adding empty href attributes to link tags will cause unwanted route changes.
+ This is why we need to remove empty href attributes from directive templates and as a result
+ styling is not applied correctly. The remedy is simple, just add the following styling to your application:
+
+ .nav, .pagination, .carousel a {
+ cursor: pointer;
+ }
+
+