angular-ui-bootstrap-rails 0.7.0.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe089ecd018be0c237c16d85397979a0f281acd1
4
- data.tar.gz: eac81065cbfdcffadb2b05c660be0789e792add4
3
+ metadata.gz: 71cc98184944e7fc4f8a6fe12a0ba804143cc6db
4
+ data.tar.gz: 5f2d107fc3794afe40cd6bf8b7f372000e278a02
5
5
  SHA512:
6
- metadata.gz: 1305e93d0e5cf178502db5fd1f5a35290749bf191e20f0de0612f4bc50999413768c364c8abf5d4b3ba8651608b2aef805f0f95ee6787df61552f88016bae7e9
7
- data.tar.gz: 1c260ec8341bbfa522ae6bdf0ec039ebf9e594570357b9a16b386413163034cb3d9cea7e7678c34994e06e7d1195427489d8d474b9e57728b2f2e57b2c7a4844
6
+ metadata.gz: 98c1f71c0274ccd7fbd4599fa12c7d9277955dcc2a1e46a1bfce2851518b2225815f71ba10486c371ad5fd9978d4fec77c6c2e10caddec1929bd0d61bb3bab0b
7
+ data.tar.gz: ffa6e5b5787d79f6281d53b5c42b4c09df0c195423f56a9a66c11ba17f0ccaeb0386d1d0355e9e92cb27bdbb52997a2fa56bcefede9cc8631228693570c0846a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # angular-ui-bootstrap-rails
2
2
 
3
- angular-ui-bootstrap-rails wraps the [Angular.js UI Bootstrap: branch bootstrap3](http://angular-ui.github.com/bootstrap) library for use in Rails 3.1 and above. Assets will minify automatically during production.
3
+ angular-ui-bootstrap-rails wraps the [Angular.js UI Bootstrap](http://angular-ui.github.com/bootstrap) library for use in Rails 3.1 and above. Assets will minify automatically during production.
4
4
 
5
5
  ## Usage
6
6
 
@@ -1,7 +1,7 @@
1
1
  module AngularUI
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "0.7.0.1"
4
+ VERSION = "0.9.0"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdownToggle","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]);
2
- angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/popup.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset-titles.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]);
2
+ angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/popup.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]);
3
3
  angular.module('ui.bootstrap.transition', [])
4
4
 
5
5
  /**
@@ -83,88 +83,81 @@ angular.module('ui.bootstrap.transition', [])
83
83
  return $transition;
84
84
  }]);
85
85
 
86
- angular.module('ui.bootstrap.collapse',['ui.bootstrap.transition'])
87
-
88
- // The collapsible directive indicates a block of html that will expand and collapse
89
- .directive('collapse', ['$transition', function($transition) {
90
- // CSS transitions don't work with height: auto, so we have to manually change the height to a
91
- // specific value and then once the animation completes, we can reset the height to auto.
92
- // Unfortunately if you do this while the CSS transitions are specified (i.e. in the CSS class
93
- // "collapse") then you trigger a change to height 0 in between.
94
- // The fix is to remove the "collapse" CSS class while changing the height back to auto - phew!
95
- var fixUpHeight = function(scope, element, height) {
96
- // We remove the collapse CSS class to prevent a transition when we change to height: auto
97
- element.removeClass('collapse');
98
- element.css({ height: height });
99
- // It appears that reading offsetWidth makes the browser realise that we have changed the
100
- // height already :-/
101
- var x = element[0].offsetWidth;
102
- element.addClass('collapse');
103
- };
86
+ angular.module('ui.bootstrap.collapse', ['ui.bootstrap.transition'])
104
87
 
105
- return {
106
- link: function(scope, element, attrs) {
88
+ .directive('collapse', ['$transition', function ($transition, $timeout) {
107
89
 
108
- var isCollapsed;
109
- var initialAnimSkip = true;
90
+ return {
91
+ link: function (scope, element, attrs) {
110
92
 
111
- scope.$watch(attrs.collapse, function(value) {
112
- if (value) {
113
- collapse();
114
- } else {
115
- expand();
93
+ var initialAnimSkip = true;
94
+ var currentTransition;
95
+
96
+ function doTransition(change) {
97
+ var newTransition = $transition(element, change);
98
+ if (currentTransition) {
99
+ currentTransition.cancel();
100
+ }
101
+ currentTransition = newTransition;
102
+ newTransition.then(newTransitionDone, newTransitionDone);
103
+ return newTransition;
104
+
105
+ function newTransitionDone() {
106
+ // Make sure it's this transition, otherwise, leave it alone.
107
+ if (currentTransition === newTransition) {
108
+ currentTransition = undefined;
109
+ }
110
+ }
116
111
  }
117
- });
118
-
119
112
 
120
- var currentTransition;
121
- var doTransition = function(change) {
122
- if ( currentTransition ) {
123
- currentTransition.cancel();
113
+ function expand() {
114
+ if (initialAnimSkip) {
115
+ initialAnimSkip = false;
116
+ expandDone();
117
+ } else {
118
+ element.removeClass('collapse').addClass('collapsing');
119
+ doTransition({ height: element[0].scrollHeight + 'px' }).then(expandDone);
120
+ }
121
+ }
122
+
123
+ function expandDone() {
124
+ element.removeClass('collapsing');
125
+ element.addClass('collapse in');
126
+ element.css({height: 'auto'});
124
127
  }
125
- currentTransition = $transition(element,change);
126
- currentTransition.then(
127
- function() { currentTransition = undefined; },
128
- function() { currentTransition = undefined; }
129
- );
130
- return currentTransition;
131
- };
132
128
 
133
- var expand = function() {
134
- if (initialAnimSkip) {
135
- initialAnimSkip = false;
136
- if ( !isCollapsed ) {
137
- fixUpHeight(scope, element, 'auto');
138
- element.addClass('in');
129
+ function collapse() {
130
+ if (initialAnimSkip) {
131
+ initialAnimSkip = false;
132
+ collapseDone();
133
+ element.css({height: 0});
134
+ } else {
135
+ // CSS transitions don't work with height: auto, so we have to manually change the height to a specific value
136
+ element.css({ height: element[0].scrollHeight + 'px' });
137
+ //trigger reflow so a browser relaizes that height was updated from auto to a specific value
138
+ var x = element[0].offsetWidth;
139
+
140
+ element.removeClass('collapse in').addClass('collapsing');
141
+
142
+ doTransition({ height: 0 }).then(collapseDone);
139
143
  }
140
- } else {
141
- doTransition({ height : element[0].scrollHeight + 'px' })
142
- .then(function() {
143
- // This check ensures that we don't accidentally update the height if the user has closed
144
- // the group while the animation was still running
145
- if ( !isCollapsed ) {
146
- fixUpHeight(scope, element, 'auto');
147
- element.addClass('in');
148
- }
149
- });
150
144
  }
151
- isCollapsed = false;
152
- };
153
-
154
- var collapse = function() {
155
- isCollapsed = true;
156
- element.removeClass('in');
157
- if (initialAnimSkip) {
158
- initialAnimSkip = false;
159
- fixUpHeight(scope, element, 0);
160
- } else {
161
- fixUpHeight(scope, element, element[0].scrollHeight + 'px');
162
- doTransition({'height':'0'});
145
+
146
+ function collapseDone() {
147
+ element.removeClass('collapsing');
148
+ element.addClass('collapse');
163
149
  }
164
- };
165
- }
166
- };
167
- }]);
150
+
151
+ scope.$watch(attrs.collapse, function (shouldCollapse) {
152
+ if (shouldCollapse) {
153
+ collapse();
154
+ } else {
155
+ expand();
156
+ }
157
+ });
158
+ }
159
+ };
160
+ }]);
168
161
 
169
162
  angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
170
163
 
@@ -177,9 +170,6 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
177
170
  // This array keeps track of the accordion groups
178
171
  this.groups = [];
179
172
 
180
- // Keep reference to user's scope to properly assign `is-open`
181
- this.scope = $scope;
182
-
183
173
  // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to
184
174
  this.closeOthers = function(openGroup) {
185
175
  var closeOthers = angular.isDefined($attrs.closeOthers) ? $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers;
@@ -225,7 +215,7 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
225
215
  })
226
216
 
227
217
  // The accordion-group directive indicates a block of html that will expand and collapse in an accordion
228
- .directive('accordionGroup', ['$parse', '$transition', '$timeout', function($parse, $transition, $timeout) {
218
+ .directive('accordionGroup', ['$parse', function($parse) {
229
219
  return {
230
220
  require:'^accordion', // We need this directive to be inside an accordion
231
221
  restrict:'EA',
@@ -233,11 +223,11 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
233
223
  replace: true, // The element containing the directive will be replaced with the template
234
224
  templateUrl:'template/accordion/accordion-group.html',
235
225
  scope:{ heading:'@' }, // Create an isolated scope and interpolate the heading attribute onto this scope
236
- controller: ['$scope', function($scope) {
226
+ controller: function() {
237
227
  this.setHeading = function(element) {
238
228
  this.heading = element;
239
229
  };
240
- }],
230
+ },
241
231
  link: function(scope, element, attrs, accordionCtrl) {
242
232
  var getIsOpen, setIsOpen;
243
233
 
@@ -249,7 +239,7 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
249
239
  getIsOpen = $parse(attrs.isOpen);
250
240
  setIsOpen = getIsOpen.assign;
251
241
 
252
- accordionCtrl.scope.$watch(getIsOpen, function(value) {
242
+ scope.$parent.$watch(getIsOpen, function(value) {
253
243
  scope.isOpen = !!value;
254
244
  });
255
245
  }
@@ -259,7 +249,7 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
259
249
  accordionCtrl.closeOthers(scope);
260
250
  }
261
251
  if ( setIsOpen ) {
262
- setIsOpen(accordionCtrl.scope, value);
252
+ setIsOpen(scope.$parent, value);
263
253
  }
264
254
  });
265
255
  }
@@ -308,18 +298,22 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
308
298
  };
309
299
  });
310
300
 
311
- angular.module("ui.bootstrap.alert", []).directive('alert', function () {
301
+ angular.module("ui.bootstrap.alert", [])
302
+
303
+ .controller('AlertController', ['$scope', '$attrs', function ($scope, $attrs) {
304
+ $scope.closeable = 'close' in $attrs;
305
+ }])
306
+
307
+ .directive('alert', function () {
312
308
  return {
313
309
  restrict:'EA',
310
+ controller:'AlertController',
314
311
  templateUrl:'template/alert/alert.html',
315
312
  transclude:true,
316
313
  replace:true,
317
314
  scope: {
318
315
  type: '=',
319
316
  close: '&'
320
- },
321
- link: function(scope, iElement, iAttrs) {
322
- scope.closeable = "close" in iAttrs;
323
317
  }
324
318
  };
325
319
  });
@@ -341,22 +335,26 @@ angular.module('ui.bootstrap.buttons', [])
341
335
  toggleEvent: 'click'
342
336
  })
343
337
 
344
- .directive('btnRadio', ['buttonConfig', function (buttonConfig) {
345
- var activeClass = buttonConfig.activeClass || 'active';
346
- var toggleEvent = buttonConfig.toggleEvent || 'click';
338
+ .controller('ButtonsController', ['buttonConfig', function(buttonConfig) {
339
+ this.activeClass = buttonConfig.activeClass || 'active';
340
+ this.toggleEvent = buttonConfig.toggleEvent || 'click';
341
+ }])
347
342
 
343
+ .directive('btnRadio', function () {
348
344
  return {
349
- require: 'ngModel',
350
- link: function (scope, element, attrs, ngModelCtrl) {
345
+ require: ['btnRadio', 'ngModel'],
346
+ controller: 'ButtonsController',
347
+ link: function (scope, element, attrs, ctrls) {
348
+ var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];
351
349
 
352
350
  //model -> UI
353
351
  ngModelCtrl.$render = function () {
354
- element.toggleClass(activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.btnRadio)));
352
+ element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.btnRadio)));
355
353
  };
356
354
 
357
355
  //ui->model
358
- element.bind(toggleEvent, function () {
359
- if (!element.hasClass(activeClass)) {
356
+ element.bind(buttonsCtrl.toggleEvent, function () {
357
+ if (!element.hasClass(buttonsCtrl.activeClass)) {
360
358
  scope.$apply(function () {
361
359
  ngModelCtrl.$setViewValue(scope.$eval(attrs.btnRadio));
362
360
  ngModelCtrl.$render();
@@ -365,41 +363,43 @@ angular.module('ui.bootstrap.buttons', [])
365
363
  });
366
364
  }
367
365
  };
368
- }])
369
-
370
- .directive('btnCheckbox', ['buttonConfig', function (buttonConfig) {
371
- var activeClass = buttonConfig.activeClass || 'active';
372
- var toggleEvent = buttonConfig.toggleEvent || 'click';
366
+ })
373
367
 
368
+ .directive('btnCheckbox', function () {
374
369
  return {
375
- require: 'ngModel',
376
- link: function (scope, element, attrs, ngModelCtrl) {
370
+ require: ['btnCheckbox', 'ngModel'],
371
+ controller: 'ButtonsController',
372
+ link: function (scope, element, attrs, ctrls) {
373
+ var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];
377
374
 
378
375
  function getTrueValue() {
379
- var trueValue = scope.$eval(attrs.btnCheckboxTrue);
380
- return angular.isDefined(trueValue) ? trueValue : true;
376
+ return getCheckboxValue(attrs.btnCheckboxTrue, true);
381
377
  }
382
378
 
383
379
  function getFalseValue() {
384
- var falseValue = scope.$eval(attrs.btnCheckboxFalse);
385
- return angular.isDefined(falseValue) ? falseValue : false;
380
+ return getCheckboxValue(attrs.btnCheckboxFalse, false);
381
+ }
382
+
383
+ function getCheckboxValue(attributeValue, defaultValue) {
384
+ var val = scope.$eval(attributeValue);
385
+ return angular.isDefined(val) ? val : defaultValue;
386
386
  }
387
387
 
388
388
  //model -> UI
389
389
  ngModelCtrl.$render = function () {
390
- element.toggleClass(activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));
390
+ element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));
391
391
  };
392
392
 
393
393
  //ui->model
394
- element.bind(toggleEvent, function () {
394
+ element.bind(buttonsCtrl.toggleEvent, function () {
395
395
  scope.$apply(function () {
396
- ngModelCtrl.$setViewValue(element.hasClass(activeClass) ? getFalseValue() : getTrueValue());
396
+ ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue());
397
397
  ngModelCtrl.$render();
398
398
  });
399
399
  });
400
400
  }
401
401
  };
402
- }]);
402
+ });
403
403
 
404
404
  /**
405
405
  * @ngdoc overview
@@ -417,6 +417,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
417
417
  currentTimeout, isPlaying;
418
418
  self.currentSlide = null;
419
419
 
420
+ var destroyed = false;
420
421
  /* direction: "prev" or "next" */
421
422
  self.select = function(nextSlide, direction) {
422
423
  var nextIndex = slides.indexOf(nextSlide);
@@ -434,6 +435,8 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
434
435
  }
435
436
  }
436
437
  function goNext() {
438
+ // Scope has been destroyed, stop here.
439
+ if (destroyed) { return; }
437
440
  //If we have a slide to transition from and we have a transition type and we're allowed, go
438
441
  if (self.currentSlide && angular.isString(direction) && !$scope.noTransition && nextSlide.$element) {
439
442
  //We shouldn't do class manip in here, but it's the same weird thing bootstrap does. need to fix sometime
@@ -469,6 +472,9 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
469
472
  $scope.$currentTransition = null;
470
473
  }
471
474
  };
475
+ $scope.$on('$destroy', function () {
476
+ destroyed = true;
477
+ });
472
478
 
473
479
  /* Allow outside people to call indexOf on slides array */
474
480
  self.indexOfSlide = function(slide) {
@@ -506,23 +512,32 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
506
512
  };
507
513
 
508
514
  $scope.$watch('interval', restartTimer);
515
+ $scope.$on('$destroy', resetTimer);
516
+
509
517
  function restartTimer() {
518
+ resetTimer();
519
+ var interval = +$scope.interval;
520
+ if (!isNaN(interval) && interval>=0) {
521
+ currentTimeout = $timeout(timerFn, interval);
522
+ }
523
+ }
524
+
525
+ function resetTimer() {
510
526
  if (currentTimeout) {
511
527
  $timeout.cancel(currentTimeout);
528
+ currentTimeout = null;
512
529
  }
513
- function go() {
514
- if (isPlaying) {
515
- $scope.next();
516
- restartTimer();
517
- } else {
518
- $scope.pause();
519
- }
520
- }
521
- var interval = +$scope.interval;
522
- if (!isNaN(interval) && interval>=0) {
523
- currentTimeout = $timeout(go, interval);
530
+ }
531
+
532
+ function timerFn() {
533
+ if (isPlaying) {
534
+ $scope.next();
535
+ restartTimer();
536
+ } else {
537
+ $scope.pause();
524
538
  }
525
539
  }
540
+
526
541
  $scope.play = function() {
527
542
  if (!isPlaying) {
528
543
  isPlaying = true;
@@ -532,9 +547,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
532
547
  $scope.pause = function() {
533
548
  if (!$scope.noPause) {
534
549
  isPlaying = false;
535
- if (currentTimeout) {
536
- $timeout.cancel(currentTimeout);
537
- }
550
+ resetTimer();
538
551
  }
539
552
  };
540
553
 
@@ -566,6 +579,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
566
579
  currentIndex--;
567
580
  }
568
581
  };
582
+
569
583
  }])
570
584
 
571
585
  /**
@@ -1033,7 +1047,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.position'])
1033
1047
 
1034
1048
  scope.select = function( date ) {
1035
1049
  if ( mode === 0 ) {
1036
- var dt = new Date( ngModel.$modelValue );
1050
+ var dt = ngModel.$modelValue ? new Date( ngModel.$modelValue ) : new Date(0, 0, 0, 0, 0, 0, 0);
1037
1051
  dt.setFullYear( date.getFullYear(), date.getMonth(), date.getDate() );
1038
1052
  ngModel.$setViewValue( dt );
1039
1053
  refill( true );
@@ -1074,7 +1088,8 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.position'])
1074
1088
  clearText: 'Clear',
1075
1089
  closeText: 'Done',
1076
1090
  closeOnDateSelection: true,
1077
- appendToBody: false
1091
+ appendToBody: false,
1092
+ showButtonBar: true
1078
1093
  })
1079
1094
 
1080
1095
  .directive('datepickerPopup', ['$compile', '$parse', '$document', '$position', 'dateFilter', 'datepickerPopupConfig', 'datepickerConfig',
@@ -1083,19 +1098,20 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1083
1098
  restrict: 'EA',
1084
1099
  require: 'ngModel',
1085
1100
  link: function(originalScope, element, attrs, ngModel) {
1086
- var dateFormat;
1101
+ var scope = originalScope.$new(), // create a child scope so we are not polluting original one
1102
+ dateFormat,
1103
+ closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? originalScope.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection,
1104
+ appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? originalScope.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody;
1105
+
1087
1106
  attrs.$observe('datepickerPopup', function(value) {
1088
1107
  dateFormat = value || datepickerPopupConfig.dateFormat;
1089
1108
  ngModel.$render();
1090
1109
  });
1091
1110
 
1092
- var closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? originalScope.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection;
1093
- var appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? originalScope.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody;
1094
-
1095
- // create a child scope for the datepicker directive so we are not polluting original scope
1096
- var scope = originalScope.$new();
1111
+ scope.showButtonBar = angular.isDefined(attrs.showButtonBar) ? originalScope.$eval(attrs.showButtonBar) : datepickerPopupConfig.showButtonBar;
1097
1112
 
1098
1113
  originalScope.$on('$destroy', function() {
1114
+ $popup.remove();
1099
1115
  scope.$destroy();
1100
1116
  });
1101
1117
 
@@ -1181,7 +1197,10 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1181
1197
  ngModel.$parsers.unshift(parseDate);
1182
1198
 
1183
1199
  // Inner change
1184
- scope.dateSelection = function() {
1200
+ scope.dateSelection = function(dt) {
1201
+ if (angular.isDefined(dt)) {
1202
+ scope.date = dt;
1203
+ }
1185
1204
  ngModel.$setViewValue(scope.date);
1186
1205
  ngModel.$render();
1187
1206
 
@@ -1192,7 +1211,7 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1192
1211
 
1193
1212
  element.bind('input change keyup', function() {
1194
1213
  scope.$apply(function() {
1195
- updateCalendar();
1214
+ scope.date = ngModel.$modelValue;
1196
1215
  });
1197
1216
  });
1198
1217
 
@@ -1200,14 +1219,8 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1200
1219
  ngModel.$render = function() {
1201
1220
  var date = ngModel.$viewValue ? dateFilter(ngModel.$viewValue, dateFormat) : '';
1202
1221
  element.val(date);
1203
-
1204
- updateCalendar();
1205
- };
1206
-
1207
- function updateCalendar() {
1208
1222
  scope.date = ngModel.$modelValue;
1209
- updatePosition();
1210
- }
1223
+ };
1211
1224
 
1212
1225
  function addWatchableAttribute(attribute, scopeProperty, datepickerAttribute) {
1213
1226
  if (attribute) {
@@ -1257,13 +1270,11 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1257
1270
  }
1258
1271
  });
1259
1272
 
1260
- var $setModelValue = $parse(attrs.ngModel).assign;
1261
-
1262
1273
  scope.today = function() {
1263
- $setModelValue(originalScope, new Date());
1274
+ scope.dateSelection(new Date());
1264
1275
  };
1265
1276
  scope.clear = function() {
1266
- $setModelValue(originalScope, null);
1277
+ scope.dateSelection(null);
1267
1278
  };
1268
1279
 
1269
1280
  var $popup = $compile(popupEl)(scope);
@@ -1408,7 +1419,10 @@ angular.module('ui.bootstrap.modal', [])
1408
1419
  restrict: 'EA',
1409
1420
  replace: true,
1410
1421
  templateUrl: 'template/modal/backdrop.html',
1411
- link: function (scope, element, attrs) {
1422
+ link: function (scope) {
1423
+
1424
+ scope.animate = false;
1425
+
1412
1426
  //trigger CSS transitions
1413
1427
  $timeout(function () {
1414
1428
  scope.animate = true;
@@ -1429,9 +1443,11 @@ angular.module('ui.bootstrap.modal', [])
1429
1443
  link: function (scope, element, attrs) {
1430
1444
  scope.windowClass = attrs.windowClass || '';
1431
1445
 
1432
- //trigger CSS transitions
1433
1446
  $timeout(function () {
1447
+ // trigger CSS transitions
1434
1448
  scope.animate = true;
1449
+ // focus a freshly-opened modal
1450
+ element[0].focus();
1435
1451
  });
1436
1452
 
1437
1453
  scope.close = function (evt) {
@@ -1449,9 +1465,10 @@ angular.module('ui.bootstrap.modal', [])
1449
1465
  .factory('$modalStack', ['$document', '$compile', '$rootScope', '$$stackedMap',
1450
1466
  function ($document, $compile, $rootScope, $$stackedMap) {
1451
1467
 
1468
+ var OPENED_MODAL_CLASS = 'modal-open';
1469
+
1452
1470
  var backdropjqLiteEl, backdropDomEl;
1453
1471
  var backdropScope = $rootScope.$new(true);
1454
- var body = $document.find('body').eq(0);
1455
1472
  var openedWindows = $$stackedMap.createNew();
1456
1473
  var $modalStack = {};
1457
1474
 
@@ -1466,16 +1483,13 @@ angular.module('ui.bootstrap.modal', [])
1466
1483
  return topBackdropIndex;
1467
1484
  }
1468
1485
 
1469
- $rootScope.$watch(openedWindows.length, function(noOfModals){
1470
- body.toggleClass('modal-open', openedWindows.length() > 0);
1471
- });
1472
-
1473
1486
  $rootScope.$watch(backdropIndex, function(newBackdropIndex){
1474
1487
  backdropScope.index = newBackdropIndex;
1475
1488
  });
1476
1489
 
1477
1490
  function removeModalWindow(modalInstance) {
1478
1491
 
1492
+ var body = $document.find('body').eq(0);
1479
1493
  var modalWindow = openedWindows.get(modalInstance).value;
1480
1494
 
1481
1495
  //clean up the stack
@@ -1483,6 +1497,7 @@ angular.module('ui.bootstrap.modal', [])
1483
1497
 
1484
1498
  //remove window DOM element
1485
1499
  modalWindow.modalDomEl.remove();
1500
+ body.toggleClass(OPENED_MODAL_CLASS, openedWindows.length() > 0);
1486
1501
 
1487
1502
  //remove backdrop if no longer needed
1488
1503
  if (backdropDomEl && backdropIndex() == -1) {
@@ -1516,6 +1531,14 @@ angular.module('ui.bootstrap.modal', [])
1516
1531
  keyboard: modal.keyboard
1517
1532
  });
1518
1533
 
1534
+ var body = $document.find('body').eq(0);
1535
+
1536
+ if (backdropIndex() >= 0 && !backdropDomEl) {
1537
+ backdropjqLiteEl = angular.element('<div modal-backdrop></div>');
1538
+ backdropDomEl = $compile(backdropjqLiteEl)(backdropScope);
1539
+ body.append(backdropDomEl);
1540
+ }
1541
+
1519
1542
  var angularDomEl = angular.element('<div modal-window></div>');
1520
1543
  angularDomEl.attr('window-class', modal.windowClass);
1521
1544
  angularDomEl.attr('index', openedWindows.length() - 1);
@@ -1524,12 +1547,7 @@ angular.module('ui.bootstrap.modal', [])
1524
1547
  var modalDomEl = $compile(angularDomEl)(modal.scope);
1525
1548
  openedWindows.top().value.modalDomEl = modalDomEl;
1526
1549
  body.append(modalDomEl);
1527
-
1528
- if (backdropIndex() >= 0 && !backdropDomEl) {
1529
- backdropjqLiteEl = angular.element('<div modal-backdrop></div>');
1530
- backdropDomEl = $compile(backdropjqLiteEl)(backdropScope);
1531
- body.append(backdropDomEl);
1532
- }
1550
+ body.addClass(OPENED_MODAL_CLASS);
1533
1551
  };
1534
1552
 
1535
1553
  $modalStack.close = function (modalInstance, result) {
@@ -2003,14 +2021,14 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2003
2021
  var startSym = $interpolate.startSymbol();
2004
2022
  var endSym = $interpolate.endSymbol();
2005
2023
  var template =
2006
- '<'+ directiveName +'-popup '+
2024
+ '<div '+ directiveName +'-popup '+
2007
2025
  'title="'+startSym+'tt_title'+endSym+'" '+
2008
2026
  'content="'+startSym+'tt_content'+endSym+'" '+
2009
2027
  'placement="'+startSym+'tt_placement'+endSym+'" '+
2010
- 'animation="tt_animation()" '+
2028
+ 'animation="tt_animation" '+
2011
2029
  'is-open="tt_isOpen"'+
2012
2030
  '>'+
2013
- '</'+ directiveName +'-popup>';
2031
+ '</div>';
2014
2032
 
2015
2033
  return {
2016
2034
  restrict: 'EA',
@@ -2019,12 +2037,60 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2019
2037
  var tooltip = $compile( template )( scope );
2020
2038
  var transitionTimeout;
2021
2039
  var popupTimeout;
2022
- var $body;
2023
2040
  var appendToBody = angular.isDefined( options.appendToBody ) ? options.appendToBody : false;
2024
2041
  var triggers = getTriggers( undefined );
2025
2042
  var hasRegisteredTriggers = false;
2026
2043
  var hasEnableExp = angular.isDefined(attrs[prefix+'Enable']);
2027
2044
 
2045
+ var positionTooltip = function (){
2046
+ var position,
2047
+ ttWidth,
2048
+ ttHeight,
2049
+ ttPosition;
2050
+ // Get the position of the directive element.
2051
+ position = appendToBody ? $position.offset( element ) : $position.position( element );
2052
+
2053
+ // Get the height and width of the tooltip so we can center it.
2054
+ ttWidth = tooltip.prop( 'offsetWidth' );
2055
+ ttHeight = tooltip.prop( 'offsetHeight' );
2056
+
2057
+ // Calculate the tooltip's top and left coordinates to center it with
2058
+ // this directive.
2059
+ switch ( scope.tt_placement ) {
2060
+ case 'right':
2061
+ ttPosition = {
2062
+ top: position.top + position.height / 2 - ttHeight / 2,
2063
+ left: position.left + position.width
2064
+ };
2065
+ break;
2066
+ case 'bottom':
2067
+ ttPosition = {
2068
+ top: position.top + position.height,
2069
+ left: position.left + position.width / 2 - ttWidth / 2
2070
+ };
2071
+ break;
2072
+ case 'left':
2073
+ ttPosition = {
2074
+ top: position.top + position.height / 2 - ttHeight / 2,
2075
+ left: position.left - ttWidth
2076
+ };
2077
+ break;
2078
+ default:
2079
+ ttPosition = {
2080
+ top: position.top - ttHeight,
2081
+ left: position.left + position.width / 2 - ttWidth / 2
2082
+ };
2083
+ break;
2084
+ }
2085
+
2086
+ ttPosition.top += 'px';
2087
+ ttPosition.left += 'px';
2088
+
2089
+ // Now set the calculated positioning.
2090
+ tooltip.css( ttPosition );
2091
+
2092
+ };
2093
+
2028
2094
  // By default, the tooltip is not open.
2029
2095
  // TODO add ability to start tooltip opened
2030
2096
  scope.tt_isOpen = false;
@@ -2044,8 +2110,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2044
2110
  }
2045
2111
  if ( scope.tt_popupDelay ) {
2046
2112
  popupTimeout = $timeout( show, scope.tt_popupDelay );
2113
+ popupTimeout.then(function(reposition){reposition();});
2047
2114
  } else {
2048
- scope.$apply( show );
2115
+ scope.$apply( show )();
2049
2116
  }
2050
2117
  }
2051
2118
 
@@ -2057,14 +2124,11 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2057
2124
 
2058
2125
  // Show the tooltip popup element.
2059
2126
  function show() {
2060
- var position,
2061
- ttWidth,
2062
- ttHeight,
2063
- ttPosition;
2127
+
2064
2128
 
2065
2129
  // Don't show empty tooltips.
2066
2130
  if ( ! scope.tt_content ) {
2067
- return;
2131
+ return angular.noop;
2068
2132
  }
2069
2133
 
2070
2134
  // If there is a pending remove transition, we must cancel it, lest the
@@ -2079,56 +2143,19 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2079
2143
  // Now we add it to the DOM because need some info about it. But it's not
2080
2144
  // visible yet anyway.
2081
2145
  if ( appendToBody ) {
2082
- $body = $body || $document.find( 'body' );
2083
- $body.append( tooltip );
2146
+ $document.find( 'body' ).append( tooltip );
2084
2147
  } else {
2085
2148
  element.after( tooltip );
2086
2149
  }
2087
2150
 
2088
- // Get the position of the directive element.
2089
- position = appendToBody ? $position.offset( element ) : $position.position( element );
2090
-
2091
- // Get the height and width of the tooltip so we can center it.
2092
- ttWidth = tooltip.prop( 'offsetWidth' );
2093
- ttHeight = tooltip.prop( 'offsetHeight' );
2094
-
2095
- // Calculate the tooltip's top and left coordinates to center it with
2096
- // this directive.
2097
- switch ( scope.tt_placement ) {
2098
- case 'right':
2099
- ttPosition = {
2100
- top: position.top + position.height / 2 - ttHeight / 2,
2101
- left: position.left + position.width
2102
- };
2103
- break;
2104
- case 'bottom':
2105
- ttPosition = {
2106
- top: position.top + position.height,
2107
- left: position.left + position.width / 2 - ttWidth / 2
2108
- };
2109
- break;
2110
- case 'left':
2111
- ttPosition = {
2112
- top: position.top + position.height / 2 - ttHeight / 2,
2113
- left: position.left - ttWidth
2114
- };
2115
- break;
2116
- default:
2117
- ttPosition = {
2118
- top: position.top - ttHeight,
2119
- left: position.left + position.width / 2 - ttWidth / 2
2120
- };
2121
- break;
2122
- }
2123
-
2124
- ttPosition.top += 'px';
2125
- ttPosition.left += 'px';
2151
+ positionTooltip();
2126
2152
 
2127
- // Now set the calculated positioning.
2128
- tooltip.css( ttPosition );
2129
-
2130
2153
  // And show the tooltip.
2131
2154
  scope.tt_isOpen = true;
2155
+
2156
+ // Return positioning function as promise callback for correct
2157
+ // positioning after draw.
2158
+ return positionTooltip;
2132
2159
  }
2133
2160
 
2134
2161
  // Hide the tooltip popup element.
@@ -2142,8 +2169,10 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2142
2169
  // And now we remove it from the DOM. However, if we have animation, we
2143
2170
  // need to wait for it to expire beforehand.
2144
2171
  // FIXME: this is a placeholder for a port of the transitions library.
2145
- if ( angular.isDefined( scope.tt_animation ) && scope.tt_animation() ) {
2146
- transitionTimeout = $timeout( function () { tooltip.remove(); }, 500 );
2172
+ if ( scope.tt_animation ) {
2173
+ transitionTimeout = $timeout(function () {
2174
+ tooltip.remove();
2175
+ }, 500);
2147
2176
  } else {
2148
2177
  tooltip.remove();
2149
2178
  }
@@ -2153,12 +2182,10 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2153
2182
  * Observe the relevant attributes.
2154
2183
  */
2155
2184
  attrs.$observe( type, function ( val ) {
2156
- if (val) {
2157
- scope.tt_content = val;
2158
- } else {
2159
- if ( scope.tt_isOpen ) {
2160
- hide();
2161
- }
2185
+ scope.tt_content = val;
2186
+
2187
+ if (!val && scope.tt_isOpen ) {
2188
+ hide();
2162
2189
  }
2163
2190
  });
2164
2191
 
@@ -2170,21 +2197,20 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2170
2197
  scope.tt_placement = angular.isDefined( val ) ? val : options.placement;
2171
2198
  });
2172
2199
 
2173
- attrs.$observe( prefix+'Animation', function ( val ) {
2174
- scope.tt_animation = angular.isDefined( val ) ? $parse( val ) : function(){ return options.animation; };
2175
- });
2176
-
2177
2200
  attrs.$observe( prefix+'PopupDelay', function ( val ) {
2178
2201
  var delay = parseInt( val, 10 );
2179
2202
  scope.tt_popupDelay = ! isNaN(delay) ? delay : options.popupDelay;
2180
2203
  });
2181
2204
 
2182
- attrs.$observe( prefix+'Trigger', function ( val ) {
2183
-
2205
+ var unregisterTriggers = function() {
2184
2206
  if (hasRegisteredTriggers) {
2185
2207
  element.unbind( triggers.show, showTooltipBind );
2186
2208
  element.unbind( triggers.hide, hideTooltipBind );
2187
2209
  }
2210
+ };
2211
+
2212
+ attrs.$observe( prefix+'Trigger', function ( val ) {
2213
+ unregisterTriggers();
2188
2214
 
2189
2215
  triggers = getTriggers( val );
2190
2216
 
@@ -2198,6 +2224,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2198
2224
  hasRegisteredTriggers = true;
2199
2225
  });
2200
2226
 
2227
+ var animation = scope.$eval(attrs[prefix + 'Animation']);
2228
+ scope.tt_animation = angular.isDefined(animation) ? !!animation : options.animation;
2229
+
2201
2230
  attrs.$observe( prefix+'AppendToBody', function ( val ) {
2202
2231
  appendToBody = angular.isDefined( val ) ? $parse( val )( scope ) : appendToBody;
2203
2232
  });
@@ -2215,11 +2244,12 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2215
2244
 
2216
2245
  // Make sure tooltip is destroyed and removed.
2217
2246
  scope.$on('$destroy', function onDestroyTooltip() {
2218
- if ( scope.tt_isOpen ) {
2219
- hide();
2220
- } else {
2221
- tooltip.remove();
2222
- }
2247
+ $timeout.cancel( transitionTimeout );
2248
+ $timeout.cancel( popupTimeout );
2249
+ unregisterTriggers();
2250
+ tooltip.remove();
2251
+ tooltip.unbind();
2252
+ tooltip = null;
2223
2253
  });
2224
2254
  }
2225
2255
  };
@@ -2229,7 +2259,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2229
2259
 
2230
2260
  .directive( 'tooltipPopup', function () {
2231
2261
  return {
2232
- restrict: 'E',
2262
+ restrict: 'EA',
2233
2263
  replace: true,
2234
2264
  scope: { content: '@', placement: '@', animation: '&', isOpen: '&' },
2235
2265
  templateUrl: 'template/tooltip/tooltip-popup.html'
@@ -2242,7 +2272,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2242
2272
 
2243
2273
  .directive( 'tooltipHtmlUnsafePopup', function () {
2244
2274
  return {
2245
- restrict: 'E',
2275
+ restrict: 'EA',
2246
2276
  replace: true,
2247
2277
  scope: { content: '@', placement: '@', animation: '&', isOpen: '&' },
2248
2278
  templateUrl: 'template/tooltip/tooltip-html-unsafe-popup.html'
@@ -2276,108 +2306,102 @@ angular.module('ui.bootstrap.progressbar', ['ui.bootstrap.transition'])
2276
2306
 
2277
2307
  .constant('progressConfig', {
2278
2308
  animate: true,
2279
- autoType: false,
2280
- stackedTypes: ['success', 'info', 'warning', 'danger']
2309
+ max: 100
2281
2310
  })
2282
2311
 
2283
- .controller('ProgressBarController', ['$scope', '$attrs', 'progressConfig', function($scope, $attrs, progressConfig) {
2312
+ .controller('ProgressController', ['$scope', '$attrs', 'progressConfig', '$transition', function($scope, $attrs, progressConfig, $transition) {
2313
+ var self = this,
2314
+ bars = [],
2315
+ max = angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : progressConfig.max,
2316
+ animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate;
2284
2317
 
2285
- // Whether bar transitions should be animated
2286
- var animate = angular.isDefined($attrs.animate) ? $scope.$eval($attrs.animate) : progressConfig.animate;
2287
- var autoType = angular.isDefined($attrs.autoType) ? $scope.$eval($attrs.autoType) : progressConfig.autoType;
2288
- var stackedTypes = angular.isDefined($attrs.stackedTypes) ? $scope.$eval('[' + $attrs.stackedTypes + ']') : progressConfig.stackedTypes;
2318
+ this.addBar = function(bar, element) {
2319
+ var oldValue = 0, index = bar.$parent.$index;
2320
+ if ( angular.isDefined(index) && bars[index] ) {
2321
+ oldValue = bars[index].value;
2322
+ }
2323
+ bars.push(bar);
2289
2324
 
2290
- // Create bar object
2291
- this.makeBar = function(newBar, oldBar, index) {
2292
- var newValue = (angular.isObject(newBar)) ? newBar.value : (newBar || 0);
2293
- var oldValue = (angular.isObject(oldBar)) ? oldBar.value : (oldBar || 0);
2294
- var type = (angular.isObject(newBar) && angular.isDefined(newBar.type)) ? newBar.type : (autoType) ? getStackedType(index || 0) : null;
2325
+ this.update(element, bar.value, oldValue);
2295
2326
 
2296
- return {
2297
- from: oldValue,
2298
- to: newValue,
2299
- type: type,
2300
- animate: animate
2301
- };
2327
+ bar.$watch('value', function(value, oldValue) {
2328
+ if (value !== oldValue) {
2329
+ self.update(element, value, oldValue);
2330
+ }
2331
+ });
2332
+
2333
+ bar.$on('$destroy', function() {
2334
+ self.removeBar(bar);
2335
+ });
2302
2336
  };
2303
2337
 
2304
- function getStackedType(index) {
2305
- return stackedTypes[index];
2306
- }
2338
+ // Update bar element width
2339
+ this.update = function(element, newValue, oldValue) {
2340
+ var percent = this.getPercentage(newValue);
2307
2341
 
2308
- this.addBar = function(bar) {
2309
- $scope.bars.push(bar);
2310
- $scope.totalPercent += bar.to;
2342
+ if (animate) {
2343
+ element.css('width', this.getPercentage(oldValue) + '%');
2344
+ $transition(element, {width: percent + '%'});
2345
+ } else {
2346
+ element.css({'transition': 'none', 'width': percent + '%'});
2347
+ }
2311
2348
  };
2312
2349
 
2313
- this.clearBars = function() {
2314
- $scope.bars = [];
2315
- $scope.totalPercent = 0;
2350
+ this.removeBar = function(bar) {
2351
+ bars.splice(bars.indexOf(bar), 1);
2352
+ };
2353
+
2354
+ this.getPercentage = function(value) {
2355
+ return Math.round(100 * value / max);
2316
2356
  };
2317
- this.clearBars();
2318
2357
  }])
2319
2358
 
2320
2359
  .directive('progress', function() {
2321
2360
  return {
2322
2361
  restrict: 'EA',
2323
2362
  replace: true,
2324
- controller: 'ProgressBarController',
2363
+ transclude: true,
2364
+ controller: 'ProgressController',
2365
+ require: 'progress',
2366
+ scope: {},
2367
+ template: '<div class="progress" ng-transclude></div>'
2368
+ //templateUrl: 'template/progressbar/progress.html' // Works in AngularJS 1.2
2369
+ };
2370
+ })
2371
+
2372
+ .directive('bar', function() {
2373
+ return {
2374
+ restrict: 'EA',
2375
+ replace: true,
2376
+ transclude: true,
2377
+ require: '^progress',
2325
2378
  scope: {
2326
- value: '=percent',
2327
- onFull: '&',
2328
- onEmpty: '&'
2379
+ value: '=',
2380
+ type: '@'
2329
2381
  },
2330
- templateUrl: 'template/progressbar/progress.html',
2331
- link: function(scope, element, attrs, controller) {
2332
- scope.$watch('value', function(newValue, oldValue) {
2333
- controller.clearBars();
2334
-
2335
- if (angular.isArray(newValue)) {
2336
- // Stacked progress bar
2337
- for (var i=0, n=newValue.length; i < n; i++) {
2338
- controller.addBar(controller.makeBar(newValue[i], oldValue[i], i));
2339
- }
2340
- } else {
2341
- // Simple bar
2342
- controller.addBar(controller.makeBar(newValue, oldValue));
2343
- }
2344
- }, true);
2345
-
2346
- // Total percent listeners
2347
- scope.$watch('totalPercent', function(value) {
2348
- if (value >= 100) {
2349
- scope.onFull();
2350
- } else if (value <= 0) {
2351
- scope.onEmpty();
2352
- }
2353
- }, true);
2382
+ templateUrl: 'template/progressbar/bar.html',
2383
+ link: function(scope, element, attrs, progressCtrl) {
2384
+ progressCtrl.addBar(scope, element);
2354
2385
  }
2355
2386
  };
2356
2387
  })
2357
2388
 
2358
- .directive('progressbar', ['$transition', function($transition) {
2389
+ .directive('progressbar', function() {
2359
2390
  return {
2360
2391
  restrict: 'EA',
2361
2392
  replace: true,
2393
+ transclude: true,
2394
+ controller: 'ProgressController',
2362
2395
  scope: {
2363
- width: '=',
2364
- old: '=',
2365
- type: '=',
2366
- animate: '='
2396
+ value: '=',
2397
+ type: '@'
2367
2398
  },
2368
- templateUrl: 'template/progressbar/bar.html',
2369
- link: function(scope, element) {
2370
- scope.$watch('width', function(value) {
2371
- if (scope.animate) {
2372
- element.css('width', scope.old + '%');
2373
- $transition(element, {width: value + '%'});
2374
- } else {
2375
- element.css('width', value + '%');
2376
- }
2377
- });
2399
+ templateUrl: 'template/progressbar/progressbar.html',
2400
+ link: function(scope, element, attrs, progressCtrl) {
2401
+ progressCtrl.addBar(scope, angular.element(element.children()[0]));
2378
2402
  }
2379
2403
  };
2380
- }]);
2404
+ });
2381
2405
  angular.module('ui.bootstrap.rating', [])
2382
2406
 
2383
2407
  .constant('ratingConfig', {
@@ -2463,12 +2487,6 @@ angular.module('ui.bootstrap.rating', [])
2463
2487
 
2464
2488
  angular.module('ui.bootstrap.tabs', [])
2465
2489
 
2466
- .directive('tabs', function() {
2467
- return function() {
2468
- throw new Error("The `tabs` directive is deprecated, please migrate to `tabset`. Instructions can be found at http://github.com/angular-ui/bootstrap/tree/master/CHANGELOG.md");
2469
- };
2470
- })
2471
-
2472
2490
  .controller('TabsetController', ['$scope', function TabsetCtrl($scope) {
2473
2491
  var ctrl = this,
2474
2492
  tabs = ctrl.tabs = $scope.tabs = [];
@@ -2509,8 +2527,6 @@ angular.module('ui.bootstrap.tabs', [])
2509
2527
  *
2510
2528
  * @param {boolean=} vertical Whether or not to use vertical styling for the tabs.
2511
2529
  * @param {boolean=} justified Whether or not to use justified styling for the tabs.
2512
- * @param {string=} direction What direction the tabs should be rendered. Available:
2513
- * 'right', 'left', 'below'.
2514
2530
  *
2515
2531
  * @example
2516
2532
  <example module="ui.bootstrap">
@@ -2536,20 +2552,13 @@ angular.module('ui.bootstrap.tabs', [])
2536
2552
  restrict: 'EA',
2537
2553
  transclude: true,
2538
2554
  replace: true,
2539
- require: '^tabset',
2540
2555
  scope: {},
2541
2556
  controller: 'TabsetController',
2542
2557
  templateUrl: 'template/tabs/tabset.html',
2543
- compile: function(elm, attrs, transclude) {
2544
- return function(scope, element, attrs, tabsetCtrl) {
2545
- scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
2546
- scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false;
2547
- scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
2548
- scope.direction = angular.isDefined(attrs.direction) ? scope.$parent.$eval(attrs.direction) : 'top';
2549
- scope.tabsAbove = (scope.direction != 'below');
2550
- tabsetCtrl.$scope = scope;
2551
- tabsetCtrl.$transcludeFn = transclude;
2552
- };
2558
+ link: function(scope, element, attrs) {
2559
+ scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
2560
+ scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false;
2561
+ scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
2553
2562
  }
2554
2563
  };
2555
2564
  })
@@ -2754,24 +2763,7 @@ angular.module('ui.bootstrap.tabs', [])
2754
2763
  }
2755
2764
  })
2756
2765
 
2757
- .directive('tabsetTitles', function() {
2758
- return {
2759
- restrict: 'A',
2760
- require: '^tabset',
2761
- templateUrl: 'template/tabs/tabset-titles.html',
2762
- replace: true,
2763
- link: function(scope, elm, attrs, tabsetCtrl) {
2764
- if (!scope.$eval(attrs.tabsetTitles)) {
2765
- elm.remove();
2766
- } else {
2767
- //now that tabs location has been decided, transclude the tab titles in
2768
- tabsetCtrl.$transcludeFn(tabsetCtrl.$scope.$parent, function(node) {
2769
- elm.append(node);
2770
- });
2771
- }
2772
- }
2773
- };
2774
- });
2766
+ ;
2775
2767
 
2776
2768
  angular.module('ui.bootstrap.timepicker', [])
2777
2769
 
@@ -2779,12 +2771,12 @@ angular.module('ui.bootstrap.timepicker', [])
2779
2771
  hourStep: 1,
2780
2772
  minuteStep: 1,
2781
2773
  showMeridian: true,
2782
- meridians: ['AM', 'PM'],
2774
+ meridians: null,
2783
2775
  readonlyInput: false,
2784
2776
  mousewheel: true
2785
2777
  })
2786
2778
 
2787
- .directive('timepicker', ['$parse', '$log', 'timepickerConfig', function ($parse, $log, timepickerConfig) {
2779
+ .directive('timepicker', ['$parse', '$log', 'timepickerConfig', '$locale', function ($parse, $log, timepickerConfig, $locale) {
2788
2780
  return {
2789
2781
  restrict: 'EA',
2790
2782
  require:'?^ngModel',
@@ -2796,7 +2788,8 @@ angular.module('ui.bootstrap.timepicker', [])
2796
2788
  return; // do nothing if no ng-model
2797
2789
  }
2798
2790
 
2799
- var selected = new Date(), meridians = timepickerConfig.meridians;
2791
+ var selected = new Date(),
2792
+ meridians = angular.isDefined(attrs.meridians) ? scope.$parent.$eval(attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS;
2800
2793
 
2801
2794
  var hourStep = timepickerConfig.hourStep;
2802
2795
  if (attrs.hourStep) {
@@ -3065,6 +3058,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3065
3058
 
3066
3059
  var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined;
3067
3060
 
3061
+ var appendToBody = attrs.typeaheadAppendToBody ? $parse(attrs.typeaheadAppendToBody) : false;
3062
+
3068
3063
  //INTERNAL VARIABLES
3069
3064
 
3070
3065
  //model setter executed upon match selection
@@ -3076,7 +3071,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3076
3071
  var hasFocus;
3077
3072
 
3078
3073
  //pop-up element used to display matches
3079
- var popUpEl = angular.element('<typeahead-popup></typeahead-popup>');
3074
+ var popUpEl = angular.element('<div typeahead-popup></div>');
3080
3075
  popUpEl.attr({
3081
3076
  matches: 'matches',
3082
3077
  active: 'activeIdx',
@@ -3128,7 +3123,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3128
3123
  //position pop-up with matches - we need to re-calculate its position each time we are opening a window
3129
3124
  //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page
3130
3125
  //due to other elements being rendered
3131
- scope.position = $position.position(element);
3126
+ scope.position = appendToBody ? $position.offset(element) : $position.position(element);
3132
3127
  scope.position.top = scope.position.top + element.prop('offsetHeight');
3133
3128
 
3134
3129
  } else {
@@ -3236,9 +3231,6 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3236
3231
 
3237
3232
  //typeahead is open and an "interesting" key was pressed
3238
3233
  if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {
3239
- if (evt.which === 13) {
3240
- evt.preventDefault();
3241
- }
3242
3234
  return;
3243
3235
  }
3244
3236
 
@@ -3283,7 +3275,12 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3283
3275
  $document.unbind('click', dismissClickHandler);
3284
3276
  });
3285
3277
 
3286
- element.after($compile(popUpEl)(scope));
3278
+ var $popup = $compile(popUpEl)(scope);
3279
+ if ( appendToBody ) {
3280
+ $document.find('body').append($popup);
3281
+ } else {
3282
+ element.after($popup);
3283
+ }
3287
3284
  }
3288
3285
  };
3289
3286
 
@@ -3291,7 +3288,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3291
3288
 
3292
3289
  .directive('typeaheadPopup', function () {
3293
3290
  return {
3294
- restrict:'E',
3291
+ restrict:'EA',
3295
3292
  scope:{
3296
3293
  matches:'=',
3297
3294
  query:'=',
@@ -3326,7 +3323,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
3326
3323
 
3327
3324
  .directive('typeaheadMatch', ['$http', '$templateCache', '$compile', '$parse', function ($http, $templateCache, $compile, $parse) {
3328
3325
  return {
3329
- restrict:'E',
3326
+ restrict:'EA',
3330
3327
  scope:{
3331
3328
  index:'=',
3332
3329
  match:'=',
@@ -3356,7 +3353,7 @@ angular.module("template/accordion/accordion-group.html", []).run(["$templateCac
3356
3353
  "<div class=\"panel panel-default\">\n" +
3357
3354
  " <div class=\"panel-heading\">\n" +
3358
3355
  " <h4 class=\"panel-title\">\n" +
3359
- " <a href=\"\" class=\"accordion-toggle\" ng-click=\"isOpen = !isOpen\" accordion-transclude=\"heading\">{{heading}}</a>\n" +
3356
+ " <a class=\"accordion-toggle\" ng-click=\"isOpen = !isOpen\" accordion-transclude=\"heading\">{{heading}}</a>\n" +
3360
3357
  " </h4>\n" +
3361
3358
  " </div>\n" +
3362
3359
  " <div class=\"panel-collapse\" collapse=\"!isOpen\">\n" +
@@ -3406,50 +3403,41 @@ angular.module("template/carousel/slide.html", []).run(["$templateCache", functi
3406
3403
 
3407
3404
  angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) {
3408
3405
  $templateCache.put("template/datepicker/datepicker.html",
3409
- "<table style=\"table-layout:fixed;\" class=\"table-condensed\">\n" +
3410
- " <!-- secondary: last month, disabled: disabled -->\n" +
3411
- " <thead class=\"text-center\">\n" +
3406
+ "<table>\n" +
3407
+ " <thead>\n" +
3412
3408
  " <tr>\n" +
3413
- " <th style=\"overflow: hidden; min-width: 26px\">\n" +
3414
- " <button type=\"button\" class=\"btn btn-xs btn-link\" ng-click=\"move(-1)\"> \n" +
3415
- " <span class=\"glyphicon glyphicon-chevron-left\"> </span> \n" +
3416
- " </button>\n" +
3417
- " </th>\n" +
3418
- " <th colspan=\"{{rows[0].length - 2 + showWeekNumbers}}\"><button type=\"button\" class=\"btn btn-md btn-link btn-block\" ng-click=\"toggleMode()\"><strong>{{title}}</strong></button></th>\n" +
3419
- " <th style=\"overflow: hidden; min-width: 26px\">\n" +
3420
- " <button type=\"button\" class=\"btn btn-xs btn-link\" ng-click=\"move(1)\"> \n" +
3421
- " <span class=\"glyphicon glyphicon-chevron-right\"> </span> \n" +
3422
- " </button>\n" +
3423
- " </th>\n" +
3409
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left\" ng-click=\"move(-1)\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
3410
+ " <th colspan=\"{{rows[0].length - 2 + showWeekNumbers}}\"><button type=\"button\" class=\"btn btn-default btn-sm btn-block\" ng-click=\"toggleMode()\"><strong>{{title}}</strong></button></th>\n" +
3411
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right\" ng-click=\"move(1)\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
3424
3412
  " </tr>\n" +
3425
- " <tr ng-show=\"labels.length > 0\">\n" +
3426
- " <th class=\"text-center\" ng-show=\"showWeekNumbers\" style=\"overflow: hidden; min-width: 26px\"><h6>#</h6></th>\n" +
3427
- " <th class=\"text-center\" ng-repeat=\"label in labels\" style=\"overflow: hidden; min-width: 26px\"><h6>{{label}}</h6></th>\n" +
3413
+ " <tr ng-show=\"labels.length > 0\" class=\"h6\">\n" +
3414
+ " <th ng-show=\"showWeekNumbers\" class=\"text-center\">#</th>\n" +
3415
+ " <th ng-repeat=\"label in labels\" class=\"text-center\">{{label}}</th>\n" +
3428
3416
  " </tr>\n" +
3429
3417
  " </thead>\n" +
3430
3418
  " <tbody>\n" +
3431
3419
  " <tr ng-repeat=\"row in rows\">\n" +
3432
- " <td ng-show=\"showWeekNumbers\" class=\"text-center\" style=\"overflow: hidden; min-width: 26px\"><button type=\"button\" class=\"btn btn-xs btn-link\" disabled><strong><em>{{ getWeekNumber(row) }}</em></strong></button></td>\n" +
3433
- " <td ng-repeat=\"dt in row\" class=\"text-center\" style=\"overflow: hidden; min-width: 26px\">\n" +
3434
- " <button type=\"button\" style=\"width: 100%; border: 0px\" class=\"btn btn-xs\" ng-class=\"{'btn-primary': dt.selected, 'btn-default': !dt.selected}\" ng-click=\"select(dt.date)\" ng-disabled=\"dt.disabled\"><span ng-class=\"{'text-muted': dt.secondary && !dt.selected}\">{{dt.label}}</span></button>\n" +
3420
+ " <td ng-show=\"showWeekNumbers\" class=\"text-center\"><em>{{ getWeekNumber(row) }}</em></td>\n" +
3421
+ " <td ng-repeat=\"dt in row\" class=\"text-center\">\n" +
3422
+ " <button type=\"button\" style=\"width:100%;\" class=\"btn btn-default btn-sm\" ng-class=\"{'btn-info': dt.selected}\" ng-click=\"select(dt.date)\" ng-disabled=\"dt.disabled\"><span ng-class=\"{'text-muted': dt.secondary}\">{{dt.label}}</span></button>\n" +
3435
3423
  " </td>\n" +
3436
3424
  " </tr>\n" +
3437
3425
  " </tbody>\n" +
3438
- "</table>");
3426
+ "</table>\n" +
3427
+ "");
3439
3428
  }]);
3440
3429
 
3441
3430
  angular.module("template/datepicker/popup.html", []).run(["$templateCache", function($templateCache) {
3442
3431
  $templateCache.put("template/datepicker/popup.html",
3443
3432
  "<ul class=\"dropdown-menu\" ng-style=\"{display: (isOpen && 'block') || 'none', top: position.top+'px', left: position.left+'px'}\">\n" +
3444
3433
  " <li ng-transclude></li>\n" +
3445
- " <li class=\"divider\"></li>\n" +
3446
- " <li style=\"padding: 9px;\">\n" +
3434
+ " <li ng-show=\"showButtonBar\" style=\"padding:10px 9px 2px\">\n" +
3447
3435
  " <span class=\"btn-group\">\n" +
3448
- " <button class=\"btn btn-xs btn-default\" ng-click=\"today()\">Today</button>\n" +
3449
- " <button class=\"btn btn-xs btn-info\" ng-click=\"showWeeks = ! showWeeks\" ng-class=\"{active: showWeeks}\">Weeks</button>\n" +
3450
- " <button class=\"btn btn-xs btn-danger\" ng-click=\"clear()\">Clear</button>\n" +
3436
+ " <button type=\"button\" class=\"btn btn-sm btn-info\" ng-click=\"today()\">{{currentText}}</button>\n" +
3437
+ " <button type=\"button\" class=\"btn btn-sm btn-default\" ng-click=\"showWeeks = ! showWeeks\" ng-class=\"{active: showWeeks}\">{{toggleWeeksText}}</button>\n" +
3438
+ " <button type=\"button\" class=\"btn btn-sm btn-danger\" ng-click=\"clear()\">{{clearText}}</button>\n" +
3451
3439
  " </span>\n" +
3452
- " <button class=\"btn btn-xs btn-success pull-right\" ng-click=\"isOpen = false\">Close</button>\n" +
3440
+ " <button type=\"button\" class=\"btn btn-sm btn-success pull-right\" ng-click=\"isOpen = false\">{{closeText}}</button>\n" +
3453
3441
  " </li>\n" +
3454
3442
  "</ul>\n" +
3455
3443
  "");
@@ -3462,7 +3450,7 @@ angular.module("template/modal/backdrop.html", []).run(["$templateCache", functi
3462
3450
 
3463
3451
  angular.module("template/modal/window.html", []).run(["$templateCache", function($templateCache) {
3464
3452
  $templateCache.put("template/modal/window.html",
3465
- "<div class=\"modal fade {{ windowClass }}\" ng-class=\"{in: animate}\" ng-style=\"{'z-index': 1050 + index*10, display: 'block'}\" ng-click=\"close($event)\">\n" +
3453
+ "<div tabindex=\"-1\" class=\"modal fade {{ windowClass }}\" ng-class=\"{in: animate}\" ng-style=\"{'z-index': 1050 + index*10, display: 'block'}\" ng-click=\"close($event)\">\n" +
3466
3454
  " <div class=\"modal-dialog\"><div class=\"modal-content\" ng-transclude></div></div>\n" +
3467
3455
  "</div>");
3468
3456
  }]);
@@ -3470,7 +3458,7 @@ angular.module("template/modal/window.html", []).run(["$templateCache", function
3470
3458
  angular.module("template/pagination/pager.html", []).run(["$templateCache", function($templateCache) {
3471
3459
  $templateCache.put("template/pagination/pager.html",
3472
3460
  "<ul class=\"pager\">\n" +
3473
- " <li ng-repeat=\"page in pages\" ng-class=\"{disabled: page.disabled, previous: page.previous, next: page.next}\"><a ng-click=\"selectPage(page.number)\">{{page.text}}</a></li>\n" +
3461
+ " <li ng-repeat=\"page in pages\" ng-class=\"{disabled: page.disabled, previous: page.previous, next: page.next}\"><a ng-click=\"selectPage(page.number)\">{{page.text}}</a></li>\n" +
3474
3462
  "</ul>");
3475
3463
  }]);
3476
3464
 
@@ -3478,8 +3466,7 @@ angular.module("template/pagination/pagination.html", []).run(["$templateCache",
3478
3466
  $templateCache.put("template/pagination/pagination.html",
3479
3467
  "<ul class=\"pagination\">\n" +
3480
3468
  " <li ng-repeat=\"page in pages\" ng-class=\"{active: page.active, disabled: page.disabled}\"><a ng-click=\"selectPage(page.number)\">{{page.text}}</a></li>\n" +
3481
- "</ul>\n" +
3482
- "");
3469
+ "</ul>");
3483
3470
  }]);
3484
3471
 
3485
3472
  angular.module("template/tooltip/tooltip-html-unsafe-popup.html", []).run(["$templateCache", function($templateCache) {
@@ -3515,12 +3502,17 @@ angular.module("template/popover/popover.html", []).run(["$templateCache", funct
3515
3502
 
3516
3503
  angular.module("template/progressbar/bar.html", []).run(["$templateCache", function($templateCache) {
3517
3504
  $templateCache.put("template/progressbar/bar.html",
3518
- "<div class=\"bar\" ng-class='type && \"bar-\" + type'></div>");
3505
+ "<div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" ng-transclude></div>");
3519
3506
  }]);
3520
3507
 
3521
3508
  angular.module("template/progressbar/progress.html", []).run(["$templateCache", function($templateCache) {
3522
3509
  $templateCache.put("template/progressbar/progress.html",
3523
- "<div class=\"progress\"><progressbar ng-repeat=\"bar in bars\" width=\"bar.to\" old=\"bar.from\" animate=\"bar.animate\" type=\"bar.type\"></progressbar></div>");
3510
+ "<div class=\"progress\" ng-transclude></div>");
3511
+ }]);
3512
+
3513
+ angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function($templateCache) {
3514
+ $templateCache.put("template/progressbar/progressbar.html",
3515
+ "<div class=\"progress\"><div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" ng-transclude></div></div>");
3524
3516
  }]);
3525
3517
 
3526
3518
  angular.module("template/rating/rating.html", []).run(["$templateCache", function($templateCache) {
@@ -3540,7 +3532,7 @@ angular.module("template/tabs/tab.html", []).run(["$templateCache", function($te
3540
3532
 
3541
3533
  angular.module("template/tabs/tabset-titles.html", []).run(["$templateCache", function($templateCache) {
3542
3534
  $templateCache.put("template/tabs/tabset-titles.html",
3543
- "<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\">\n" +
3535
+ "<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n" +
3544
3536
  "</ul>\n" +
3545
3537
  "");
3546
3538
  }]);
@@ -3548,8 +3540,8 @@ angular.module("template/tabs/tabset-titles.html", []).run(["$templateCache", fu
3548
3540
  angular.module("template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) {
3549
3541
  $templateCache.put("template/tabs/tabset.html",
3550
3542
  "\n" +
3551
- "<div class=\"tabbable\" ng-class=\"{'tabs-right': direction == 'right', 'tabs-left': direction == 'left', 'tabs-below': direction == 'below'}\">\n" +
3552
- " <div tabset-titles=\"tabsAbove\"></div>\n" +
3543
+ "<div class=\"tabbable\">\n" +
3544
+ " <ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\" ng-transclude></ul>\n" +
3553
3545
  " <div class=\"tab-content\">\n" +
3554
3546
  " <div class=\"tab-pane\" \n" +
3555
3547
  " ng-repeat=\"tab in tabs\" \n" +
@@ -3557,51 +3549,39 @@ angular.module("template/tabs/tabset.html", []).run(["$templateCache", function(
3557
3549
  " tab-content-transclude=\"tab\">\n" +
3558
3550
  " </div>\n" +
3559
3551
  " </div>\n" +
3560
- " <div tabset-titles=\"!tabsAbove\"></div>\n" +
3561
3552
  "</div>\n" +
3562
3553
  "");
3563
3554
  }]);
3564
3555
 
3565
3556
  angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function($templateCache) {
3566
3557
  $templateCache.put("template/timepicker/timepicker.html",
3567
- "<span>\n" +
3568
- " <div class=\"row\">\n" +
3569
- " <div class=\"col-xs-4 text-center\">\n" +
3570
- " <a ng-click=\"incrementHours()\" class=\"btn btn-link\"><i class=\"glyphicon glyphicon-chevron-up\"></i></a>\n" +
3571
- " </div>\n" +
3572
- " <div class=\"col-xs-6 text-center\">\n" +
3573
- " <a ng-click=\"incrementMinutes()\" class=\"btn btn-link\"><i class=\"glyphicon glyphicon-chevron-up\"></i></a>\n" +
3574
- " </div>\n" +
3575
- " <div class=\"col-xs-2\"> </div>\n" +
3576
- " </div>\n" +
3577
- "\n" +
3578
- " <div class=\"row\">\n" +
3579
- " <div class=\"col-xs-4\">\n" +
3580
- " <div class=\"form-group\" ng-class=\"{'has-error': invalidHours}\" style=\"margin-bottom: 0px\">\n" +
3581
- " <input type=\"text\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-mousewheel=\"incrementHours()\" ng-readonly=\"readonlyInput\" maxlength=\"2\"> \n" +
3582
- " </div>\n" +
3583
- " </div>\n" +
3584
- " <div class=\"col-xs-6\">\n" +
3585
- " <div class=\"input-group\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
3586
- " <span class=\"input-group-addon\">:</span>\n" +
3587
- " <input type=\"text\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\">\n" +
3588
- " </div>\n" +
3589
- " </div>\n" +
3590
- " <div class=\"col-xs-2\">\n" +
3591
- " <button ng-click=\"toggleMeridian()\" class=\"btn btn-default text-center\" ng-show=\"showMeridian\">{{meridian}}</button>\n" +
3592
- " </div>\n" +
3593
- " </div>\n" +
3594
- "\n" +
3595
- " <div class=\"row\">\n" +
3596
- " <div class=\"col-xs-4 text-center\">\n" +
3597
- " <a ng-click=\"decrementHours()\" class=\"btn btn-link\"><i class=\"glyphicon glyphicon-chevron-down\"></i></a>\n" +
3598
- " </div>\n" +
3599
- " <div class=\"col-xs-6 text-center\">\n" +
3600
- " <a ng-click=\"decrementMinutes()\" class=\"btn btn-link\"><i class=\"glyphicon glyphicon-chevron-down\"></i></a>\n" +
3601
- " </div>\n" +
3602
- " <div class=\"col-xs-2\"> </div>\n" +
3603
- " </div>\n" +
3604
- "</span>");
3558
+ "<table>\n" +
3559
+ " <tbody>\n" +
3560
+ " <tr class=\"text-center\">\n" +
3561
+ " <td><a ng-click=\"incrementHours()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
3562
+ " <td>&nbsp;</td>\n" +
3563
+ " <td><a ng-click=\"incrementMinutes()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
3564
+ " <td ng-show=\"showMeridian\"></td>\n" +
3565
+ " </tr>\n" +
3566
+ " <tr>\n" +
3567
+ " <td style=\"width:50px;\" class=\"form-group\" ng-class=\"{'has-error': invalidHours}\">\n" +
3568
+ " <input type=\"text\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-mousewheel=\"incrementHours()\" ng-readonly=\"readonlyInput\" maxlength=\"2\">\n" +
3569
+ " </td>\n" +
3570
+ " <td>:</td>\n" +
3571
+ " <td style=\"width:50px;\" class=\"form-group\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
3572
+ " <input type=\"text\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\">\n" +
3573
+ " </td>\n" +
3574
+ " <td ng-show=\"showMeridian\"><button class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\">{{meridian}}</button></td>\n" +
3575
+ " </tr>\n" +
3576
+ " <tr class=\"text-center\">\n" +
3577
+ " <td><a ng-click=\"decrementHours()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
3578
+ " <td>&nbsp;</td>\n" +
3579
+ " <td><a ng-click=\"decrementMinutes()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
3580
+ " <td ng-show=\"showMeridian\"></td>\n" +
3581
+ " </tr>\n" +
3582
+ " </tbody>\n" +
3583
+ "</table>\n" +
3584
+ "");
3605
3585
  }]);
3606
3586
 
3607
3587
  angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) {
@@ -3613,7 +3593,7 @@ angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCac
3613
3593
  $templateCache.put("template/typeahead/typeahead-popup.html",
3614
3594
  "<ul class=\"dropdown-menu\" ng-style=\"{display: isOpen()&&'block' || 'none', top: position.top+'px', left: position.left+'px'}\">\n" +
3615
3595
  " <li ng-repeat=\"match in matches\" ng-class=\"{active: isActive($index) }\" ng-mouseenter=\"selectActive($index)\" ng-click=\"selectMatch($index)\">\n" +
3616
- " <typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></typeahead-match>\n" +
3596
+ " <div typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></div>\n" +
3617
3597
  " </li>\n" +
3618
3598
  "</ul>");
3619
3599
  }]);