angular-ui-bootstrap-rails 0.9.0 → 0.10.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: 71cc98184944e7fc4f8a6fe12a0ba804143cc6db
4
- data.tar.gz: 5f2d107fc3794afe40cd6bf8b7f372000e278a02
3
+ metadata.gz: 1f8242f5fc7aaf064a61d57097ccd63d647a31f7
4
+ data.tar.gz: 0bccd68709856ae1558baff6579b6ce3f36bb027
5
5
  SHA512:
6
- metadata.gz: 98c1f71c0274ccd7fbd4599fa12c7d9277955dcc2a1e46a1bfce2851518b2225815f71ba10486c371ad5fd9978d4fec77c6c2e10caddec1929bd0d61bb3bab0b
7
- data.tar.gz: ffa6e5b5787d79f6281d53b5c42b4c09df0c195423f56a9a66c11ba17f0ccaeb0386d1d0355e9e92cb27bdbb52997a2fa56bcefede9cc8631228693570c0846a
6
+ metadata.gz: 11d5e42f80be112f83902749ac98539576a67c4cc858db7c06ccfb64855166ea0e41741df03dc3676394f2ed08edc3cceb814a2964275ca36a285ffa8eb41492
7
+ data.tar.gz: 63d5dd56b1f5ddf4723dbb4a2d0f88f2a00f5f570a39ba92dde9d15571193cb036b57570550b81353c231b3113edd4b2795980cfa8f24a0067d420e1d57d4f6d
@@ -1,7 +1,7 @@
1
1
  module AngularUI
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,10 @@
1
+ /*
2
+ * angular-ui-bootstrap
3
+ * http://angular-ui.github.io/bootstrap/
4
+
5
+ * Version: 0.10.0 - 2014-01-13
6
+ * License: MIT
7
+ */
1
8
  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
9
  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
10
  angular.module('ui.bootstrap.transition', [])
@@ -134,7 +141,7 @@ angular.module('ui.bootstrap.collapse', ['ui.bootstrap.transition'])
134
141
  } else {
135
142
  // CSS transitions don't work with height: auto, so we have to manually change the height to a specific value
136
143
  element.css({ height: element[0].scrollHeight + 'px' });
137
- //trigger reflow so a browser relaizes that height was updated from auto to a specific value
144
+ //trigger reflow so a browser realizes that height was updated from auto to a specific value
138
145
  var x = element[0].offsetWidth;
139
146
 
140
147
  element.removeClass('collapse in').addClass('collapsing');
@@ -1167,9 +1174,11 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1167
1174
  'ng-model': 'date',
1168
1175
  'ng-change': 'dateSelection()'
1169
1176
  });
1170
- var datepickerEl = angular.element(popupEl.children()[0]);
1177
+ var datepickerEl = angular.element(popupEl.children()[0]),
1178
+ datepickerOptions = {};
1171
1179
  if (attrs.datepickerOptions) {
1172
- datepickerEl.attr(angular.extend({}, originalScope.$eval(attrs.datepickerOptions)));
1180
+ datepickerOptions = originalScope.$eval(attrs.datepickerOptions);
1181
+ datepickerEl.attr(angular.extend({}, datepickerOptions));
1173
1182
  }
1174
1183
 
1175
1184
  // TODO: reverse from dateFilter string to Date object
@@ -1235,7 +1244,7 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
1235
1244
  if (attrs.showWeeks) {
1236
1245
  addWatchableAttribute(attrs.showWeeks, 'showWeeks', 'show-weeks');
1237
1246
  } else {
1238
- scope.showWeeks = datepickerConfig.showWeeks;
1247
+ scope.showWeeks = 'show-weeks' in datepickerOptions ? datepickerOptions['show-weeks'] : datepickerConfig.showWeeks;
1239
1248
  datepickerEl.attr('show-weeks', 'showWeeks');
1240
1249
  }
1241
1250
  if (attrs.dateDisabled) {
@@ -1355,7 +1364,7 @@ angular.module('ui.bootstrap.dropdownToggle', []).directive('dropdownToggle', ['
1355
1364
  };
1356
1365
  }]);
1357
1366
 
1358
- angular.module('ui.bootstrap.modal', [])
1367
+ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
1359
1368
 
1360
1369
  /**
1361
1370
  * A helper, internal data structure that acts as a map but also allows getting / removing
@@ -1435,7 +1444,8 @@ angular.module('ui.bootstrap.modal', [])
1435
1444
  return {
1436
1445
  restrict: 'EA',
1437
1446
  scope: {
1438
- index: '@'
1447
+ index: '@',
1448
+ animate: '='
1439
1449
  },
1440
1450
  replace: true,
1441
1451
  transclude: true,
@@ -1462,13 +1472,12 @@ angular.module('ui.bootstrap.modal', [])
1462
1472
  };
1463
1473
  }])
1464
1474
 
1465
- .factory('$modalStack', ['$document', '$compile', '$rootScope', '$$stackedMap',
1466
- function ($document, $compile, $rootScope, $$stackedMap) {
1475
+ .factory('$modalStack', ['$transition', '$timeout', '$document', '$compile', '$rootScope', '$$stackedMap',
1476
+ function ($transition, $timeout, $document, $compile, $rootScope, $$stackedMap) {
1467
1477
 
1468
1478
  var OPENED_MODAL_CLASS = 'modal-open';
1469
1479
 
1470
- var backdropjqLiteEl, backdropDomEl;
1471
- var backdropScope = $rootScope.$new(true);
1480
+ var backdropDomEl, backdropScope;
1472
1481
  var openedWindows = $$stackedMap.createNew();
1473
1482
  var $modalStack = {};
1474
1483
 
@@ -1484,7 +1493,9 @@ angular.module('ui.bootstrap.modal', [])
1484
1493
  }
1485
1494
 
1486
1495
  $rootScope.$watch(backdropIndex, function(newBackdropIndex){
1487
- backdropScope.index = newBackdropIndex;
1496
+ if (backdropScope) {
1497
+ backdropScope.index = newBackdropIndex;
1498
+ }
1488
1499
  });
1489
1500
 
1490
1501
  function removeModalWindow(modalInstance) {
@@ -1496,17 +1507,53 @@ angular.module('ui.bootstrap.modal', [])
1496
1507
  openedWindows.remove(modalInstance);
1497
1508
 
1498
1509
  //remove window DOM element
1499
- modalWindow.modalDomEl.remove();
1510
+ removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, 300, checkRemoveBackdrop);
1500
1511
  body.toggleClass(OPENED_MODAL_CLASS, openedWindows.length() > 0);
1512
+ }
1501
1513
 
1502
- //remove backdrop if no longer needed
1503
- if (backdropDomEl && backdropIndex() == -1) {
1504
- backdropDomEl.remove();
1505
- backdropDomEl = undefined;
1514
+ function checkRemoveBackdrop() {
1515
+ //remove backdrop if no longer needed
1516
+ if (backdropDomEl && backdropIndex() == -1) {
1517
+ var backdropScopeRef = backdropScope;
1518
+ removeAfterAnimate(backdropDomEl, backdropScope, 150, function () {
1519
+ backdropScopeRef.$destroy();
1520
+ backdropScopeRef = null;
1521
+ });
1522
+ backdropDomEl = undefined;
1523
+ backdropScope = undefined;
1524
+ }
1525
+ }
1526
+
1527
+ function removeAfterAnimate(domEl, scope, emulateTime, done) {
1528
+ // Closing animation
1529
+ scope.animate = false;
1530
+
1531
+ var transitionEndEventName = $transition.transitionEndEventName;
1532
+ if (transitionEndEventName) {
1533
+ // transition out
1534
+ var timeout = $timeout(afterAnimating, emulateTime);
1535
+
1536
+ domEl.bind(transitionEndEventName, function () {
1537
+ $timeout.cancel(timeout);
1538
+ afterAnimating();
1539
+ scope.$apply();
1540
+ });
1541
+ } else {
1542
+ // Ensure this call is async
1543
+ $timeout(afterAnimating, 0);
1506
1544
  }
1507
1545
 
1508
- //destroy scope
1509
- modalWindow.modalScope.$destroy();
1546
+ function afterAnimating() {
1547
+ if (afterAnimating.done) {
1548
+ return;
1549
+ }
1550
+ afterAnimating.done = true;
1551
+
1552
+ domEl.remove();
1553
+ if (done) {
1554
+ done();
1555
+ }
1556
+ }
1510
1557
  }
1511
1558
 
1512
1559
  $document.bind('keydown', function (evt) {
@@ -1531,17 +1578,20 @@ angular.module('ui.bootstrap.modal', [])
1531
1578
  keyboard: modal.keyboard
1532
1579
  });
1533
1580
 
1534
- var body = $document.find('body').eq(0);
1581
+ var body = $document.find('body').eq(0),
1582
+ currBackdropIndex = backdropIndex();
1535
1583
 
1536
- if (backdropIndex() >= 0 && !backdropDomEl) {
1537
- backdropjqLiteEl = angular.element('<div modal-backdrop></div>');
1538
- backdropDomEl = $compile(backdropjqLiteEl)(backdropScope);
1539
- body.append(backdropDomEl);
1584
+ if (currBackdropIndex >= 0 && !backdropDomEl) {
1585
+ backdropScope = $rootScope.$new(true);
1586
+ backdropScope.index = currBackdropIndex;
1587
+ backdropDomEl = $compile('<div modal-backdrop></div>')(backdropScope);
1588
+ body.append(backdropDomEl);
1540
1589
  }
1541
1590
 
1542
1591
  var angularDomEl = angular.element('<div modal-window></div>');
1543
1592
  angularDomEl.attr('window-class', modal.windowClass);
1544
1593
  angularDomEl.attr('index', openedWindows.length() - 1);
1594
+ angularDomEl.attr('animate', 'animate');
1545
1595
  angularDomEl.html(modal.content);
1546
1596
 
1547
1597
  var modalDomEl = $compile(angularDomEl)(modal.scope);
@@ -1566,6 +1616,14 @@ angular.module('ui.bootstrap.modal', [])
1566
1616
  }
1567
1617
  };
1568
1618
 
1619
+ $modalStack.dismissAll = function (reason) {
1620
+ var topModal = this.getTop();
1621
+ while (topModal) {
1622
+ this.dismiss(topModal.key, reason);
1623
+ topModal = this.getTop();
1624
+ }
1625
+ };
1626
+
1569
1627
  $modalStack.getTop = function () {
1570
1628
  return openedWindows.top();
1571
1629
  };
@@ -2033,224 +2091,245 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2033
2091
  return {
2034
2092
  restrict: 'EA',
2035
2093
  scope: true,
2036
- link: function link ( scope, element, attrs ) {
2037
- var tooltip = $compile( template )( scope );
2038
- var transitionTimeout;
2039
- var popupTimeout;
2040
- var appendToBody = angular.isDefined( options.appendToBody ) ? options.appendToBody : false;
2041
- var triggers = getTriggers( undefined );
2042
- var hasRegisteredTriggers = false;
2043
- var hasEnableExp = angular.isDefined(attrs[prefix+'Enable']);
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
- }
2094
+ compile: function (tElem, tAttrs) {
2095
+ var tooltipLinker = $compile( template );
2096
+
2097
+ return function link ( scope, element, attrs ) {
2098
+ var tooltip;
2099
+ var transitionTimeout;
2100
+ var popupTimeout;
2101
+ var appendToBody = angular.isDefined( options.appendToBody ) ? options.appendToBody : false;
2102
+ var triggers = getTriggers( undefined );
2103
+ var hasRegisteredTriggers = false;
2104
+ var hasEnableExp = angular.isDefined(attrs[prefix+'Enable']);
2105
+
2106
+ var positionTooltip = function (){
2107
+ var position,
2108
+ ttWidth,
2109
+ ttHeight,
2110
+ ttPosition;
2111
+ // Get the position of the directive element.
2112
+ position = appendToBody ? $position.offset( element ) : $position.position( element );
2113
+
2114
+ // Get the height and width of the tooltip so we can center it.
2115
+ ttWidth = tooltip.prop( 'offsetWidth' );
2116
+ ttHeight = tooltip.prop( 'offsetHeight' );
2117
+
2118
+ // Calculate the tooltip's top and left coordinates to center it with
2119
+ // this directive.
2120
+ switch ( scope.tt_placement ) {
2121
+ case 'right':
2122
+ ttPosition = {
2123
+ top: position.top + position.height / 2 - ttHeight / 2,
2124
+ left: position.left + position.width
2125
+ };
2126
+ break;
2127
+ case 'bottom':
2128
+ ttPosition = {
2129
+ top: position.top + position.height,
2130
+ left: position.left + position.width / 2 - ttWidth / 2
2131
+ };
2132
+ break;
2133
+ case 'left':
2134
+ ttPosition = {
2135
+ top: position.top + position.height / 2 - ttHeight / 2,
2136
+ left: position.left - ttWidth
2137
+ };
2138
+ break;
2139
+ default:
2140
+ ttPosition = {
2141
+ top: position.top - ttHeight,
2142
+ left: position.left + position.width / 2 - ttWidth / 2
2143
+ };
2144
+ break;
2145
+ }
2085
2146
 
2086
- ttPosition.top += 'px';
2087
- ttPosition.left += 'px';
2147
+ ttPosition.top += 'px';
2148
+ ttPosition.left += 'px';
2088
2149
 
2089
- // Now set the calculated positioning.
2090
- tooltip.css( ttPosition );
2150
+ // Now set the calculated positioning.
2151
+ tooltip.css( ttPosition );
2091
2152
 
2092
- };
2153
+ };
2093
2154
 
2094
- // By default, the tooltip is not open.
2095
- // TODO add ability to start tooltip opened
2096
- scope.tt_isOpen = false;
2155
+ // By default, the tooltip is not open.
2156
+ // TODO add ability to start tooltip opened
2157
+ scope.tt_isOpen = false;
2097
2158
 
2098
- function toggleTooltipBind () {
2099
- if ( ! scope.tt_isOpen ) {
2100
- showTooltipBind();
2101
- } else {
2102
- hideTooltipBind();
2159
+ function toggleTooltipBind () {
2160
+ if ( ! scope.tt_isOpen ) {
2161
+ showTooltipBind();
2162
+ } else {
2163
+ hideTooltipBind();
2164
+ }
2103
2165
  }
2104
- }
2105
-
2106
- // Show the tooltip with delay if specified, otherwise show it immediately
2107
- function showTooltipBind() {
2108
- if(hasEnableExp && !scope.$eval(attrs[prefix+'Enable'])) {
2109
- return;
2166
+
2167
+ // Show the tooltip with delay if specified, otherwise show it immediately
2168
+ function showTooltipBind() {
2169
+ if(hasEnableExp && !scope.$eval(attrs[prefix+'Enable'])) {
2170
+ return;
2171
+ }
2172
+ if ( scope.tt_popupDelay ) {
2173
+ popupTimeout = $timeout( show, scope.tt_popupDelay, false );
2174
+ popupTimeout.then(function(reposition){reposition();});
2175
+ } else {
2176
+ show()();
2177
+ }
2110
2178
  }
2111
- if ( scope.tt_popupDelay ) {
2112
- popupTimeout = $timeout( show, scope.tt_popupDelay );
2113
- popupTimeout.then(function(reposition){reposition();});
2114
- } else {
2115
- scope.$apply( show )();
2179
+
2180
+ function hideTooltipBind () {
2181
+ scope.$apply(function () {
2182
+ hide();
2183
+ });
2116
2184
  }
2117
- }
2118
2185
 
2119
- function hideTooltipBind () {
2120
- scope.$apply(function () {
2121
- hide();
2122
- });
2123
- }
2124
-
2125
- // Show the tooltip popup element.
2126
- function show() {
2186
+ // Show the tooltip popup element.
2187
+ function show() {
2127
2188
 
2128
2189
 
2129
- // Don't show empty tooltips.
2130
- if ( ! scope.tt_content ) {
2131
- return angular.noop;
2132
- }
2190
+ // Don't show empty tooltips.
2191
+ if ( ! scope.tt_content ) {
2192
+ return angular.noop;
2193
+ }
2133
2194
 
2134
- // If there is a pending remove transition, we must cancel it, lest the
2135
- // tooltip be mysteriously removed.
2136
- if ( transitionTimeout ) {
2137
- $timeout.cancel( transitionTimeout );
2138
- }
2139
-
2140
- // Set the initial positioning.
2141
- tooltip.css({ top: 0, left: 0, display: 'block' });
2142
-
2143
- // Now we add it to the DOM because need some info about it. But it's not
2144
- // visible yet anyway.
2145
- if ( appendToBody ) {
2146
- $document.find( 'body' ).append( tooltip );
2147
- } else {
2148
- element.after( tooltip );
2195
+ createTooltip();
2196
+
2197
+ // If there is a pending remove transition, we must cancel it, lest the
2198
+ // tooltip be mysteriously removed.
2199
+ if ( transitionTimeout ) {
2200
+ $timeout.cancel( transitionTimeout );
2201
+ }
2202
+
2203
+ // Set the initial positioning.
2204
+ tooltip.css({ top: 0, left: 0, display: 'block' });
2205
+
2206
+ // Now we add it to the DOM because need some info about it. But it's not
2207
+ // visible yet anyway.
2208
+ if ( appendToBody ) {
2209
+ $document.find( 'body' ).append( tooltip );
2210
+ } else {
2211
+ element.after( tooltip );
2212
+ }
2213
+
2214
+ positionTooltip();
2215
+
2216
+ // And show the tooltip.
2217
+ scope.tt_isOpen = true;
2218
+ scope.$digest(); // digest required as $apply is not called
2219
+
2220
+ // Return positioning function as promise callback for correct
2221
+ // positioning after draw.
2222
+ return positionTooltip;
2149
2223
  }
2150
2224
 
2151
- positionTooltip();
2225
+ // Hide the tooltip popup element.
2226
+ function hide() {
2227
+ // First things first: we don't show it anymore.
2228
+ scope.tt_isOpen = false;
2229
+
2230
+ //if tooltip is going to be shown after delay, we must cancel this
2231
+ $timeout.cancel( popupTimeout );
2232
+
2233
+ // And now we remove it from the DOM. However, if we have animation, we
2234
+ // need to wait for it to expire beforehand.
2235
+ // FIXME: this is a placeholder for a port of the transitions library.
2236
+ if ( scope.tt_animation ) {
2237
+ transitionTimeout = $timeout(removeTooltip, 500);
2238
+ } else {
2239
+ removeTooltip();
2240
+ }
2241
+ }
2152
2242
 
2153
- // And show the tooltip.
2154
- scope.tt_isOpen = true;
2243
+ function createTooltip() {
2244
+ // There can only be one tooltip element per directive shown at once.
2245
+ if (tooltip) {
2246
+ removeTooltip();
2247
+ }
2248
+ tooltip = tooltipLinker(scope, function () {});
2155
2249
 
2156
- // Return positioning function as promise callback for correct
2157
- // positioning after draw.
2158
- return positionTooltip;
2159
- }
2160
-
2161
- // Hide the tooltip popup element.
2162
- function hide() {
2163
- // First things first: we don't show it anymore.
2164
- scope.tt_isOpen = false;
2250
+ // Get contents rendered into the tooltip
2251
+ scope.$digest();
2252
+ }
2165
2253
 
2166
- //if tooltip is going to be shown after delay, we must cancel this
2167
- $timeout.cancel( popupTimeout );
2168
-
2169
- // And now we remove it from the DOM. However, if we have animation, we
2170
- // need to wait for it to expire beforehand.
2171
- // FIXME: this is a placeholder for a port of the transitions library.
2172
- if ( scope.tt_animation ) {
2173
- transitionTimeout = $timeout(function () {
2254
+ function removeTooltip() {
2255
+ if (tooltip) {
2174
2256
  tooltip.remove();
2175
- }, 500);
2176
- } else {
2177
- tooltip.remove();
2257
+ tooltip = null;
2258
+ }
2178
2259
  }
2179
- }
2180
2260
 
2181
- /**
2182
- * Observe the relevant attributes.
2183
- */
2184
- attrs.$observe( type, function ( val ) {
2185
- scope.tt_content = val;
2261
+ /**
2262
+ * Observe the relevant attributes.
2263
+ */
2264
+ attrs.$observe( type, function ( val ) {
2265
+ scope.tt_content = val;
2186
2266
 
2187
- if (!val && scope.tt_isOpen ) {
2188
- hide();
2189
- }
2190
- });
2267
+ if (!val && scope.tt_isOpen ) {
2268
+ hide();
2269
+ }
2270
+ });
2191
2271
 
2192
- attrs.$observe( prefix+'Title', function ( val ) {
2193
- scope.tt_title = val;
2194
- });
2272
+ attrs.$observe( prefix+'Title', function ( val ) {
2273
+ scope.tt_title = val;
2274
+ });
2195
2275
 
2196
- attrs.$observe( prefix+'Placement', function ( val ) {
2197
- scope.tt_placement = angular.isDefined( val ) ? val : options.placement;
2198
- });
2276
+ attrs.$observe( prefix+'Placement', function ( val ) {
2277
+ scope.tt_placement = angular.isDefined( val ) ? val : options.placement;
2278
+ });
2199
2279
 
2200
- attrs.$observe( prefix+'PopupDelay', function ( val ) {
2201
- var delay = parseInt( val, 10 );
2202
- scope.tt_popupDelay = ! isNaN(delay) ? delay : options.popupDelay;
2203
- });
2280
+ attrs.$observe( prefix+'PopupDelay', function ( val ) {
2281
+ var delay = parseInt( val, 10 );
2282
+ scope.tt_popupDelay = ! isNaN(delay) ? delay : options.popupDelay;
2283
+ });
2204
2284
 
2205
- var unregisterTriggers = function() {
2206
- if (hasRegisteredTriggers) {
2207
- element.unbind( triggers.show, showTooltipBind );
2208
- element.unbind( triggers.hide, hideTooltipBind );
2209
- }
2210
- };
2285
+ var unregisterTriggers = function() {
2286
+ if (hasRegisteredTriggers) {
2287
+ element.unbind( triggers.show, showTooltipBind );
2288
+ element.unbind( triggers.hide, hideTooltipBind );
2289
+ }
2290
+ };
2211
2291
 
2212
- attrs.$observe( prefix+'Trigger', function ( val ) {
2213
- unregisterTriggers();
2292
+ attrs.$observe( prefix+'Trigger', function ( val ) {
2293
+ unregisterTriggers();
2214
2294
 
2215
- triggers = getTriggers( val );
2295
+ triggers = getTriggers( val );
2216
2296
 
2217
- if ( triggers.show === triggers.hide ) {
2218
- element.bind( triggers.show, toggleTooltipBind );
2219
- } else {
2220
- element.bind( triggers.show, showTooltipBind );
2221
- element.bind( triggers.hide, hideTooltipBind );
2222
- }
2297
+ if ( triggers.show === triggers.hide ) {
2298
+ element.bind( triggers.show, toggleTooltipBind );
2299
+ } else {
2300
+ element.bind( triggers.show, showTooltipBind );
2301
+ element.bind( triggers.hide, hideTooltipBind );
2302
+ }
2223
2303
 
2224
- hasRegisteredTriggers = true;
2225
- });
2304
+ hasRegisteredTriggers = true;
2305
+ });
2226
2306
 
2227
- var animation = scope.$eval(attrs[prefix + 'Animation']);
2228
- scope.tt_animation = angular.isDefined(animation) ? !!animation : options.animation;
2307
+ var animation = scope.$eval(attrs[prefix + 'Animation']);
2308
+ scope.tt_animation = angular.isDefined(animation) ? !!animation : options.animation;
2229
2309
 
2230
- attrs.$observe( prefix+'AppendToBody', function ( val ) {
2231
- appendToBody = angular.isDefined( val ) ? $parse( val )( scope ) : appendToBody;
2232
- });
2310
+ attrs.$observe( prefix+'AppendToBody', function ( val ) {
2311
+ appendToBody = angular.isDefined( val ) ? $parse( val )( scope ) : appendToBody;
2312
+ });
2233
2313
 
2234
- // if a tooltip is attached to <body> we need to remove it on
2235
- // location change as its parent scope will probably not be destroyed
2236
- // by the change.
2237
- if ( appendToBody ) {
2238
- scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess () {
2239
- if ( scope.tt_isOpen ) {
2240
- hide();
2314
+ // if a tooltip is attached to <body> we need to remove it on
2315
+ // location change as its parent scope will probably not be destroyed
2316
+ // by the change.
2317
+ if ( appendToBody ) {
2318
+ scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess () {
2319
+ if ( scope.tt_isOpen ) {
2320
+ hide();
2321
+ }
2322
+ });
2241
2323
  }
2242
- });
2243
- }
2244
2324
 
2245
- // Make sure tooltip is destroyed and removed.
2246
- scope.$on('$destroy', function onDestroyTooltip() {
2247
- $timeout.cancel( transitionTimeout );
2248
- $timeout.cancel( popupTimeout );
2249
- unregisterTriggers();
2250
- tooltip.remove();
2251
- tooltip.unbind();
2252
- tooltip = null;
2253
- });
2325
+ // Make sure tooltip is destroyed and removed.
2326
+ scope.$on('$destroy', function onDestroyTooltip() {
2327
+ $timeout.cancel( transitionTimeout );
2328
+ $timeout.cancel( popupTimeout );
2329
+ unregisterTriggers();
2330
+ removeTooltip();
2331
+ });
2332
+ };
2254
2333
  }
2255
2334
  };
2256
2335
  };
@@ -2289,6 +2368,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
2289
2368
  * just mouse enter/leave, html popovers, and selector delegatation.
2290
2369
  */
2291
2370
  angular.module( 'ui.bootstrap.popover', [ 'ui.bootstrap.tooltip' ] )
2371
+
2292
2372
  .directive( 'popoverPopup', function () {
2293
2373
  return {
2294
2374
  restrict: 'EA',
@@ -2297,11 +2377,11 @@ angular.module( 'ui.bootstrap.popover', [ 'ui.bootstrap.tooltip' ] )
2297
2377
  templateUrl: 'template/popover/popover.html'
2298
2378
  };
2299
2379
  })
2300
- .directive( 'popover', [ '$compile', '$timeout', '$parse', '$window', '$tooltip', function ( $compile, $timeout, $parse, $window, $tooltip ) {
2380
+
2381
+ .directive( 'popover', [ '$tooltip', function ( $tooltip ) {
2301
2382
  return $tooltip( 'popover', 'popover', 'click' );
2302
2383
  }]);
2303
2384
 
2304
-
2305
2385
  angular.module('ui.bootstrap.progressbar', ['ui.bootstrap.transition'])
2306
2386
 
2307
2387
  .constant('progressConfig', {
@@ -2432,11 +2512,9 @@ angular.module('ui.bootstrap.rating', [])
2432
2512
  $scope.range = angular.isDefined($attrs.ratingStates) ? this.createRateObjects(angular.copy($scope.$parent.$eval($attrs.ratingStates))): this.createRateObjects(new Array(this.maxRange));
2433
2513
 
2434
2514
  $scope.rate = function(value) {
2435
- if ( $scope.readonly || $scope.value === value) {
2436
- return;
2515
+ if ( $scope.value !== value && !$scope.readonly ) {
2516
+ $scope.value = value;
2437
2517
  }
2438
-
2439
- $scope.value = value;
2440
2518
  };
2441
2519
 
2442
2520
  $scope.enter = function(value) {
@@ -3571,7 +3649,7 @@ angular.module("template/timepicker/timepicker.html", []).run(["$templateCache",
3571
3649
  " <td style=\"width:50px;\" class=\"form-group\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
3572
3650
  " <input type=\"text\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\">\n" +
3573
3651
  " </td>\n" +
3574
- " <td ng-show=\"showMeridian\"><button class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\">{{meridian}}</button></td>\n" +
3652
+ " <td ng-show=\"showMeridian\"><button type=\"button\" class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\">{{meridian}}</button></td>\n" +
3575
3653
  " </tr>\n" +
3576
3654
  " <tr class=\"text-center\">\n" +
3577
3655
  " <td><a ng-click=\"decrementHours()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +