angular-ui-bootstrap-rails 0.11.2 → 0.12.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df10b4e8adfc873567fd5682bd8194ba87732ead
|
4
|
+
data.tar.gz: d967ed8853f054936fd4ac9e482abfc674c70c92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c7c0edd6d0cb906a44d05b2beeb69c5d7e5e24d2fd228da375040cc7ebb14c562ec7b9bae0774502903dc6b65d679c2c33fa92cf9d04738e2a7d211601bd537
|
7
|
+
data.tar.gz: 239a8bcf18d90786b63878cded102d86008d20f23542c2ab75fca9c492e16d43cd137fa89456f262c2ce843d33e21b0f826b587893b6e4c9858615250ba17971
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* angular-ui-bootstrap
|
3
3
|
* http://angular-ui.github.io/bootstrap/
|
4
4
|
|
5
|
-
* Version: 0.
|
5
|
+
* Version: 0.12.0 - 2014-11-16
|
6
6
|
* License: MIT
|
7
7
|
*/
|
8
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.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","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"]);
|
@@ -301,6 +301,7 @@ angular.module('ui.bootstrap.alert', [])
|
|
301
301
|
|
302
302
|
.controller('AlertController', ['$scope', '$attrs', function ($scope, $attrs) {
|
303
303
|
$scope.closeable = 'close' in $attrs;
|
304
|
+
this.close = $scope.close;
|
304
305
|
}])
|
305
306
|
|
306
307
|
.directive('alert', function () {
|
@@ -315,7 +316,18 @@ angular.module('ui.bootstrap.alert', [])
|
|
315
316
|
close: '&'
|
316
317
|
}
|
317
318
|
};
|
318
|
-
})
|
319
|
+
})
|
320
|
+
|
321
|
+
.directive('dismissOnTimeout', ['$timeout', function($timeout) {
|
322
|
+
return {
|
323
|
+
require: 'alert',
|
324
|
+
link: function(scope, element, attrs, alertCtrl) {
|
325
|
+
$timeout(function(){
|
326
|
+
alertCtrl.close();
|
327
|
+
}, parseInt(attrs.dismissOnTimeout, 10));
|
328
|
+
}
|
329
|
+
};
|
330
|
+
}]);
|
319
331
|
|
320
332
|
angular.module('ui.bootstrap.bindHtml', [])
|
321
333
|
|
@@ -411,11 +423,11 @@ angular.module('ui.bootstrap.buttons', [])
|
|
411
423
|
*
|
412
424
|
*/
|
413
425
|
angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
|
414
|
-
.controller('CarouselController', ['$scope', '$timeout', '$transition', function ($scope, $timeout, $transition) {
|
426
|
+
.controller('CarouselController', ['$scope', '$timeout', '$interval', '$transition', function ($scope, $timeout, $interval, $transition) {
|
415
427
|
var self = this,
|
416
428
|
slides = self.slides = $scope.slides = [],
|
417
429
|
currentIndex = -1,
|
418
|
-
|
430
|
+
currentInterval, isPlaying;
|
419
431
|
self.currentSlide = null;
|
420
432
|
|
421
433
|
var destroyed = false;
|
@@ -510,22 +522,22 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
|
|
510
522
|
function restartTimer() {
|
511
523
|
resetTimer();
|
512
524
|
var interval = +$scope.interval;
|
513
|
-
if (!isNaN(interval) && interval
|
514
|
-
|
525
|
+
if (!isNaN(interval) && interval > 0) {
|
526
|
+
currentInterval = $interval(timerFn, interval);
|
515
527
|
}
|
516
528
|
}
|
517
529
|
|
518
530
|
function resetTimer() {
|
519
|
-
if (
|
520
|
-
$
|
521
|
-
|
531
|
+
if (currentInterval) {
|
532
|
+
$interval.cancel(currentInterval);
|
533
|
+
currentInterval = null;
|
522
534
|
}
|
523
535
|
}
|
524
536
|
|
525
537
|
function timerFn() {
|
526
|
-
|
538
|
+
var interval = +$scope.interval;
|
539
|
+
if (isPlaying && !isNaN(interval) && interval > 0) {
|
527
540
|
$scope.next();
|
528
|
-
restartTimer();
|
529
541
|
} else {
|
530
542
|
$scope.pause();
|
531
543
|
}
|
@@ -1647,6 +1659,10 @@ angular.module('ui.bootstrap.dropdown', [])
|
|
1647
1659
|
};
|
1648
1660
|
|
1649
1661
|
var closeDropdown = function( evt ) {
|
1662
|
+
// This method may still be called during the same mouse event that
|
1663
|
+
// unbound this event handler. So check openScope before proceeding.
|
1664
|
+
if (!openScope) { return; }
|
1665
|
+
|
1650
1666
|
var toggleElement = openScope.getToggleElement();
|
1651
1667
|
if ( evt && toggleElement && toggleElement[0].contains(evt.target) ) {
|
1652
1668
|
return;
|
@@ -1732,7 +1748,6 @@ angular.module('ui.bootstrap.dropdown', [])
|
|
1732
1748
|
|
1733
1749
|
.directive('dropdown', function() {
|
1734
1750
|
return {
|
1735
|
-
restrict: 'CA',
|
1736
1751
|
controller: 'DropdownController',
|
1737
1752
|
link: function(scope, element, attrs, dropdownCtrl) {
|
1738
1753
|
dropdownCtrl.init( element );
|
@@ -1742,7 +1757,6 @@ angular.module('ui.bootstrap.dropdown', [])
|
|
1742
1757
|
|
1743
1758
|
.directive('dropdownToggle', function() {
|
1744
1759
|
return {
|
1745
|
-
restrict: 'CA',
|
1746
1760
|
require: '?^dropdown',
|
1747
1761
|
link: function(scope, element, attrs, dropdownCtrl) {
|
1748
1762
|
if ( !dropdownCtrl ) {
|
@@ -1875,7 +1889,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
|
|
1875
1889
|
|
1876
1890
|
/**
|
1877
1891
|
* Auto-focusing of a freshly-opened modal element causes any child elements
|
1878
|
-
* with the autofocus attribute to
|
1892
|
+
* with the autofocus attribute to lose focus. This is an issue on touch
|
1879
1893
|
* based devices which will show and then hide the onscreen keyboard.
|
1880
1894
|
* Attempts to refocus the autofocus element via JavaScript will not reopen
|
1881
1895
|
* the onscreen keyboard. Fixed by updated the focusing logic to only autofocus
|
@@ -2473,7 +2487,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2473
2487
|
* Returns the actual instance of the $tooltip service.
|
2474
2488
|
* TODO support multiple triggers
|
2475
2489
|
*/
|
2476
|
-
this.$get = [ '$window', '$compile', '$timeout', '$
|
2490
|
+
this.$get = [ '$window', '$compile', '$timeout', '$document', '$position', '$interpolate', function ( $window, $compile, $timeout, $document, $position, $interpolate ) {
|
2477
2491
|
return function $tooltip ( type, prefix, defaultTriggerShow ) {
|
2478
2492
|
var options = angular.extend( {}, defaultOptions, globalOptions );
|
2479
2493
|
|
@@ -2506,31 +2520,32 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2506
2520
|
var endSym = $interpolate.endSymbol();
|
2507
2521
|
var template =
|
2508
2522
|
'<div '+ directiveName +'-popup '+
|
2509
|
-
'title="'+startSym+'
|
2510
|
-
'content="'+startSym+'
|
2511
|
-
'placement="'+startSym+'
|
2512
|
-
'animation="
|
2513
|
-
'is-open="
|
2523
|
+
'title="'+startSym+'title'+endSym+'" '+
|
2524
|
+
'content="'+startSym+'content'+endSym+'" '+
|
2525
|
+
'placement="'+startSym+'placement'+endSym+'" '+
|
2526
|
+
'animation="animation" '+
|
2527
|
+
'is-open="isOpen"'+
|
2514
2528
|
'>'+
|
2515
2529
|
'</div>';
|
2516
2530
|
|
2517
2531
|
return {
|
2518
2532
|
restrict: 'EA',
|
2519
|
-
scope: true,
|
2520
2533
|
compile: function (tElem, tAttrs) {
|
2521
2534
|
var tooltipLinker = $compile( template );
|
2522
2535
|
|
2523
2536
|
return function link ( scope, element, attrs ) {
|
2524
2537
|
var tooltip;
|
2538
|
+
var tooltipLinkedScope;
|
2525
2539
|
var transitionTimeout;
|
2526
2540
|
var popupTimeout;
|
2527
2541
|
var appendToBody = angular.isDefined( options.appendToBody ) ? options.appendToBody : false;
|
2528
2542
|
var triggers = getTriggers( undefined );
|
2529
2543
|
var hasEnableExp = angular.isDefined(attrs[prefix+'Enable']);
|
2544
|
+
var ttScope = scope.$new(true);
|
2530
2545
|
|
2531
2546
|
var positionTooltip = function () {
|
2532
2547
|
|
2533
|
-
var ttPosition = $position.positionElements(element, tooltip,
|
2548
|
+
var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);
|
2534
2549
|
ttPosition.top += 'px';
|
2535
2550
|
ttPosition.left += 'px';
|
2536
2551
|
|
@@ -2540,10 +2555,10 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2540
2555
|
|
2541
2556
|
// By default, the tooltip is not open.
|
2542
2557
|
// TODO add ability to start tooltip opened
|
2543
|
-
|
2558
|
+
ttScope.isOpen = false;
|
2544
2559
|
|
2545
2560
|
function toggleTooltipBind () {
|
2546
|
-
if ( !
|
2561
|
+
if ( ! ttScope.isOpen ) {
|
2547
2562
|
showTooltipBind();
|
2548
2563
|
} else {
|
2549
2564
|
hideTooltipBind();
|
@@ -2555,11 +2570,14 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2555
2570
|
if(hasEnableExp && !scope.$eval(attrs[prefix+'Enable'])) {
|
2556
2571
|
return;
|
2557
2572
|
}
|
2558
|
-
|
2573
|
+
|
2574
|
+
prepareTooltip();
|
2575
|
+
|
2576
|
+
if ( ttScope.popupDelay ) {
|
2559
2577
|
// Do nothing if the tooltip was already scheduled to pop-up.
|
2560
2578
|
// This happens if show is triggered multiple times before any hide is triggered.
|
2561
2579
|
if (!popupTimeout) {
|
2562
|
-
popupTimeout = $timeout( show,
|
2580
|
+
popupTimeout = $timeout( show, ttScope.popupDelay, false );
|
2563
2581
|
popupTimeout.then(function(reposition){reposition();});
|
2564
2582
|
}
|
2565
2583
|
} else {
|
@@ -2586,7 +2604,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2586
2604
|
}
|
2587
2605
|
|
2588
2606
|
// Don't show empty tooltips.
|
2589
|
-
if ( !
|
2607
|
+
if ( ! ttScope.content ) {
|
2590
2608
|
return angular.noop;
|
2591
2609
|
}
|
2592
2610
|
|
@@ -2595,7 +2613,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2595
2613
|
// Set the initial positioning.
|
2596
2614
|
tooltip.css({ top: 0, left: 0, display: 'block' });
|
2597
2615
|
|
2598
|
-
// Now we add it to the DOM because need some info about it. But it's not
|
2616
|
+
// Now we add it to the DOM because need some info about it. But it's not
|
2599
2617
|
// visible yet anyway.
|
2600
2618
|
if ( appendToBody ) {
|
2601
2619
|
$document.find( 'body' ).append( tooltip );
|
@@ -2606,8 +2624,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2606
2624
|
positionTooltip();
|
2607
2625
|
|
2608
2626
|
// And show the tooltip.
|
2609
|
-
|
2610
|
-
|
2627
|
+
ttScope.isOpen = true;
|
2628
|
+
ttScope.$digest(); // digest required as $apply is not called
|
2611
2629
|
|
2612
2630
|
// Return positioning function as promise callback for correct
|
2613
2631
|
// positioning after draw.
|
@@ -2617,16 +2635,16 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2617
2635
|
// Hide the tooltip popup element.
|
2618
2636
|
function hide() {
|
2619
2637
|
// First things first: we don't show it anymore.
|
2620
|
-
|
2638
|
+
ttScope.isOpen = false;
|
2621
2639
|
|
2622
2640
|
//if tooltip is going to be shown after delay, we must cancel this
|
2623
2641
|
$timeout.cancel( popupTimeout );
|
2624
2642
|
popupTimeout = null;
|
2625
2643
|
|
2626
|
-
// And now we remove it from the DOM. However, if we have animation, we
|
2644
|
+
// And now we remove it from the DOM. However, if we have animation, we
|
2627
2645
|
// need to wait for it to expire beforehand.
|
2628
2646
|
// FIXME: this is a placeholder for a port of the transitions library.
|
2629
|
-
if (
|
2647
|
+
if ( ttScope.animation ) {
|
2630
2648
|
if (!transitionTimeout) {
|
2631
2649
|
transitionTimeout = $timeout(removeTooltip, 500);
|
2632
2650
|
}
|
@@ -2640,10 +2658,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2640
2658
|
if (tooltip) {
|
2641
2659
|
removeTooltip();
|
2642
2660
|
}
|
2643
|
-
|
2644
|
-
|
2645
|
-
// Get contents rendered into the tooltip
|
2646
|
-
scope.$digest();
|
2661
|
+
tooltipLinkedScope = ttScope.$new();
|
2662
|
+
tooltip = tooltipLinker(tooltipLinkedScope, angular.noop);
|
2647
2663
|
}
|
2648
2664
|
|
2649
2665
|
function removeTooltip() {
|
@@ -2652,38 +2668,50 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2652
2668
|
tooltip.remove();
|
2653
2669
|
tooltip = null;
|
2654
2670
|
}
|
2671
|
+
if (tooltipLinkedScope) {
|
2672
|
+
tooltipLinkedScope.$destroy();
|
2673
|
+
tooltipLinkedScope = null;
|
2674
|
+
}
|
2675
|
+
}
|
2676
|
+
|
2677
|
+
function prepareTooltip() {
|
2678
|
+
prepPlacement();
|
2679
|
+
prepPopupDelay();
|
2655
2680
|
}
|
2656
2681
|
|
2657
2682
|
/**
|
2658
2683
|
* Observe the relevant attributes.
|
2659
2684
|
*/
|
2660
2685
|
attrs.$observe( type, function ( val ) {
|
2661
|
-
|
2686
|
+
ttScope.content = val;
|
2662
2687
|
|
2663
|
-
if (!val &&
|
2688
|
+
if (!val && ttScope.isOpen ) {
|
2664
2689
|
hide();
|
2665
2690
|
}
|
2666
2691
|
});
|
2667
2692
|
|
2668
2693
|
attrs.$observe( prefix+'Title', function ( val ) {
|
2669
|
-
|
2694
|
+
ttScope.title = val;
|
2670
2695
|
});
|
2671
2696
|
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2697
|
+
function prepPlacement() {
|
2698
|
+
var val = attrs[ prefix + 'Placement' ];
|
2699
|
+
ttScope.placement = angular.isDefined( val ) ? val : options.placement;
|
2700
|
+
}
|
2675
2701
|
|
2676
|
-
|
2702
|
+
function prepPopupDelay() {
|
2703
|
+
var val = attrs[ prefix + 'PopupDelay' ];
|
2677
2704
|
var delay = parseInt( val, 10 );
|
2678
|
-
|
2679
|
-
}
|
2705
|
+
ttScope.popupDelay = ! isNaN(delay) ? delay : options.popupDelay;
|
2706
|
+
}
|
2680
2707
|
|
2681
2708
|
var unregisterTriggers = function () {
|
2682
2709
|
element.unbind(triggers.show, showTooltipBind);
|
2683
2710
|
element.unbind(triggers.hide, hideTooltipBind);
|
2684
2711
|
};
|
2685
2712
|
|
2686
|
-
|
2713
|
+
function prepTriggers() {
|
2714
|
+
var val = attrs[ prefix + 'Trigger' ];
|
2687
2715
|
unregisterTriggers();
|
2688
2716
|
|
2689
2717
|
triggers = getTriggers( val );
|
@@ -2694,21 +2722,21 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2694
2722
|
element.bind( triggers.show, showTooltipBind );
|
2695
2723
|
element.bind( triggers.hide, hideTooltipBind );
|
2696
2724
|
}
|
2697
|
-
}
|
2725
|
+
}
|
2726
|
+
prepTriggers();
|
2698
2727
|
|
2699
2728
|
var animation = scope.$eval(attrs[prefix + 'Animation']);
|
2700
|
-
|
2729
|
+
ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation;
|
2701
2730
|
|
2702
|
-
|
2703
|
-
|
2704
|
-
});
|
2731
|
+
var appendToBodyVal = scope.$eval(attrs[prefix + 'AppendToBody']);
|
2732
|
+
appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;
|
2705
2733
|
|
2706
2734
|
// if a tooltip is attached to <body> we need to remove it on
|
2707
2735
|
// location change as its parent scope will probably not be destroyed
|
2708
2736
|
// by the change.
|
2709
2737
|
if ( appendToBody ) {
|
2710
2738
|
scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess () {
|
2711
|
-
if (
|
2739
|
+
if ( ttScope.isOpen ) {
|
2712
2740
|
hide();
|
2713
2741
|
}
|
2714
2742
|
});
|
@@ -2720,6 +2748,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2720
2748
|
$timeout.cancel( popupTimeout );
|
2721
2749
|
unregisterTriggers();
|
2722
2750
|
removeTooltip();
|
2751
|
+
ttScope = null;
|
2723
2752
|
});
|
2724
2753
|
};
|
2725
2754
|
}
|
@@ -2977,14 +3006,19 @@ angular.module('ui.bootstrap.tabs', [])
|
|
2977
3006
|
|
2978
3007
|
ctrl.removeTab = function removeTab(tab) {
|
2979
3008
|
var index = tabs.indexOf(tab);
|
2980
|
-
//Select a new tab if the tab to be removed is selected
|
2981
|
-
if (tab.active && tabs.length > 1) {
|
3009
|
+
//Select a new tab if the tab to be removed is selected and not destroyed
|
3010
|
+
if (tab.active && tabs.length > 1 && !destroyed) {
|
2982
3011
|
//If this is the last tab, select the previous tab. else, the next tab.
|
2983
3012
|
var newActiveIndex = index == tabs.length - 1 ? index - 1 : index + 1;
|
2984
3013
|
ctrl.select(tabs[newActiveIndex]);
|
2985
3014
|
}
|
2986
3015
|
tabs.splice(index, 1);
|
2987
3016
|
};
|
3017
|
+
|
3018
|
+
var destroyed;
|
3019
|
+
$scope.$on('$destroy', function() {
|
3020
|
+
destroyed = true;
|
3021
|
+
});
|
2988
3022
|
}])
|
2989
3023
|
|
2990
3024
|
/**
|
@@ -3529,6 +3563,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3529
3563
|
|
3530
3564
|
var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false;
|
3531
3565
|
|
3566
|
+
var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false;
|
3567
|
+
|
3532
3568
|
//INTERNAL VARIABLES
|
3533
3569
|
|
3534
3570
|
//model setter executed upon match selection
|
@@ -3601,7 +3637,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3601
3637
|
if (onCurrentRequest && hasFocus) {
|
3602
3638
|
if (matches.length > 0) {
|
3603
3639
|
|
3604
|
-
scope.activeIdx = 0;
|
3640
|
+
scope.activeIdx = focusFirst ? 0 : -1;
|
3605
3641
|
scope.matches.length = 0;
|
3606
3642
|
|
3607
3643
|
//transform labels
|
@@ -3695,7 +3731,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3695
3731
|
|
3696
3732
|
if (inputFormatter) {
|
3697
3733
|
|
3698
|
-
locals
|
3734
|
+
locals.$model = modelValue;
|
3699
3735
|
return inputFormatter(originalScope, locals);
|
3700
3736
|
|
3701
3737
|
} else {
|
@@ -3742,6 +3778,11 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3742
3778
|
return;
|
3743
3779
|
}
|
3744
3780
|
|
3781
|
+
// if there's nothing selected (i.e. focusFirst) and enter is hit, don't do anything
|
3782
|
+
if (scope.activeIdx == -1 && (evt.which === 13 || evt.which === 9)) {
|
3783
|
+
return;
|
3784
|
+
}
|
3785
|
+
|
3745
3786
|
evt.preventDefault();
|
3746
3787
|
|
3747
3788
|
if (evt.which === 40) {
|
@@ -3749,7 +3790,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3749
3790
|
scope.$digest();
|
3750
3791
|
|
3751
3792
|
} else if (evt.which === 38) {
|
3752
|
-
scope.activeIdx = (scope.activeIdx ? scope.activeIdx : scope.matches.length) - 1;
|
3793
|
+
scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
|
3753
3794
|
scope.$digest();
|
3754
3795
|
|
3755
3796
|
} else if (evt.which === 13 || evt.which === 9) {
|
@@ -3781,10 +3822,13 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3781
3822
|
|
3782
3823
|
originalScope.$on('$destroy', function(){
|
3783
3824
|
$document.unbind('click', dismissClickHandler);
|
3825
|
+
if (appendToBody) {
|
3826
|
+
$popup.remove();
|
3827
|
+
}
|
3784
3828
|
});
|
3785
3829
|
|
3786
3830
|
var $popup = $compile(popUpEl)(scope);
|
3787
|
-
if (
|
3831
|
+
if (appendToBody) {
|
3788
3832
|
$document.find('body').append($popup);
|
3789
3833
|
} else {
|
3790
3834
|
element.after($popup);
|
@@ -3862,13 +3906,14 @@ angular.module("template/accordion/accordion-group.html", []).run(["$templateCac
|
|
3862
3906
|
"<div class=\"panel panel-default\">\n" +
|
3863
3907
|
" <div class=\"panel-heading\">\n" +
|
3864
3908
|
" <h4 class=\"panel-title\">\n" +
|
3865
|
-
" <a class=\"accordion-toggle\" ng-click=\"toggleOpen()\" accordion-transclude=\"heading\"><span ng-class=\"{'text-muted': isDisabled}\">{{heading}}</span></a>\n" +
|
3909
|
+
" <a href class=\"accordion-toggle\" ng-click=\"toggleOpen()\" accordion-transclude=\"heading\"><span ng-class=\"{'text-muted': isDisabled}\">{{heading}}</span></a>\n" +
|
3866
3910
|
" </h4>\n" +
|
3867
3911
|
" </div>\n" +
|
3868
3912
|
" <div class=\"panel-collapse\" collapse=\"!isOpen\">\n" +
|
3869
3913
|
" <div class=\"panel-body\" ng-transclude></div>\n" +
|
3870
3914
|
" </div>\n" +
|
3871
|
-
"</div
|
3915
|
+
"</div>\n" +
|
3916
|
+
"");
|
3872
3917
|
}]);
|
3873
3918
|
|
3874
3919
|
angular.module("template/accordion/accordion.html", []).run(["$templateCache", function($templateCache) {
|
@@ -3974,7 +4019,7 @@ angular.module("template/datepicker/popup.html", []).run(["$templateCache", func
|
|
3974
4019
|
"<ul class=\"dropdown-menu\" ng-style=\"{display: (isOpen && 'block') || 'none', top: position.top+'px', left: position.left+'px'}\" ng-keydown=\"keydown($event)\">\n" +
|
3975
4020
|
" <li ng-transclude></li>\n" +
|
3976
4021
|
" <li ng-if=\"showButtonBar\" style=\"padding:10px 9px 2px\">\n" +
|
3977
|
-
" <span class=\"btn-group\">\n" +
|
4022
|
+
" <span class=\"btn-group pull-left\">\n" +
|
3978
4023
|
" <button type=\"button\" class=\"btn btn-sm btn-info\" ng-click=\"select('today')\">{{ getText('current') }}</button>\n" +
|
3979
4024
|
" <button type=\"button\" class=\"btn btn-sm btn-danger\" ng-click=\"select(null)\">{{ getText('clear') }}</button>\n" +
|
3980
4025
|
" </span>\n" +
|
@@ -4100,7 +4145,7 @@ angular.module("template/rating/rating.html", []).run(["$templateCache", functio
|
|
4100
4145
|
angular.module("template/tabs/tab.html", []).run(["$templateCache", function($templateCache) {
|
4101
4146
|
$templateCache.put("template/tabs/tab.html",
|
4102
4147
|
"<li ng-class=\"{active: active, disabled: disabled}\">\n" +
|
4103
|
-
" <a ng-click=\"select()\" tab-heading-transclude>{{heading}}</a>\n" +
|
4148
|
+
" <a href ng-click=\"select()\" tab-heading-transclude>{{heading}}</a>\n" +
|
4104
4149
|
"</li>\n" +
|
4105
4150
|
"");
|
4106
4151
|
}]);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* angular-ui-bootstrap
|
3
3
|
* http://angular-ui.github.io/bootstrap/
|
4
4
|
|
5
|
-
* Version: 0.
|
5
|
+
* Version: 0.12.0 - 2014-11-16
|
6
6
|
* License: MIT
|
7
7
|
*/
|
8
8
|
angular.module("ui.bootstrap", ["ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","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"]);
|
@@ -300,6 +300,7 @@ angular.module('ui.bootstrap.alert', [])
|
|
300
300
|
|
301
301
|
.controller('AlertController', ['$scope', '$attrs', function ($scope, $attrs) {
|
302
302
|
$scope.closeable = 'close' in $attrs;
|
303
|
+
this.close = $scope.close;
|
303
304
|
}])
|
304
305
|
|
305
306
|
.directive('alert', function () {
|
@@ -314,7 +315,18 @@ angular.module('ui.bootstrap.alert', [])
|
|
314
315
|
close: '&'
|
315
316
|
}
|
316
317
|
};
|
317
|
-
})
|
318
|
+
})
|
319
|
+
|
320
|
+
.directive('dismissOnTimeout', ['$timeout', function($timeout) {
|
321
|
+
return {
|
322
|
+
require: 'alert',
|
323
|
+
link: function(scope, element, attrs, alertCtrl) {
|
324
|
+
$timeout(function(){
|
325
|
+
alertCtrl.close();
|
326
|
+
}, parseInt(attrs.dismissOnTimeout, 10));
|
327
|
+
}
|
328
|
+
};
|
329
|
+
}]);
|
318
330
|
|
319
331
|
angular.module('ui.bootstrap.bindHtml', [])
|
320
332
|
|
@@ -410,11 +422,11 @@ angular.module('ui.bootstrap.buttons', [])
|
|
410
422
|
*
|
411
423
|
*/
|
412
424
|
angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
|
413
|
-
.controller('CarouselController', ['$scope', '$timeout', '$transition', function ($scope, $timeout, $transition) {
|
425
|
+
.controller('CarouselController', ['$scope', '$timeout', '$interval', '$transition', function ($scope, $timeout, $interval, $transition) {
|
414
426
|
var self = this,
|
415
427
|
slides = self.slides = $scope.slides = [],
|
416
428
|
currentIndex = -1,
|
417
|
-
|
429
|
+
currentInterval, isPlaying;
|
418
430
|
self.currentSlide = null;
|
419
431
|
|
420
432
|
var destroyed = false;
|
@@ -509,22 +521,22 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
|
|
509
521
|
function restartTimer() {
|
510
522
|
resetTimer();
|
511
523
|
var interval = +$scope.interval;
|
512
|
-
if (!isNaN(interval) && interval
|
513
|
-
|
524
|
+
if (!isNaN(interval) && interval > 0) {
|
525
|
+
currentInterval = $interval(timerFn, interval);
|
514
526
|
}
|
515
527
|
}
|
516
528
|
|
517
529
|
function resetTimer() {
|
518
|
-
if (
|
519
|
-
$
|
520
|
-
|
530
|
+
if (currentInterval) {
|
531
|
+
$interval.cancel(currentInterval);
|
532
|
+
currentInterval = null;
|
521
533
|
}
|
522
534
|
}
|
523
535
|
|
524
536
|
function timerFn() {
|
525
|
-
|
537
|
+
var interval = +$scope.interval;
|
538
|
+
if (isPlaying && !isNaN(interval) && interval > 0) {
|
526
539
|
$scope.next();
|
527
|
-
restartTimer();
|
528
540
|
} else {
|
529
541
|
$scope.pause();
|
530
542
|
}
|
@@ -1646,6 +1658,10 @@ angular.module('ui.bootstrap.dropdown', [])
|
|
1646
1658
|
};
|
1647
1659
|
|
1648
1660
|
var closeDropdown = function( evt ) {
|
1661
|
+
// This method may still be called during the same mouse event that
|
1662
|
+
// unbound this event handler. So check openScope before proceeding.
|
1663
|
+
if (!openScope) { return; }
|
1664
|
+
|
1649
1665
|
var toggleElement = openScope.getToggleElement();
|
1650
1666
|
if ( evt && toggleElement && toggleElement[0].contains(evt.target) ) {
|
1651
1667
|
return;
|
@@ -1731,7 +1747,6 @@ angular.module('ui.bootstrap.dropdown', [])
|
|
1731
1747
|
|
1732
1748
|
.directive('dropdown', function() {
|
1733
1749
|
return {
|
1734
|
-
restrict: 'CA',
|
1735
1750
|
controller: 'DropdownController',
|
1736
1751
|
link: function(scope, element, attrs, dropdownCtrl) {
|
1737
1752
|
dropdownCtrl.init( element );
|
@@ -1741,7 +1756,6 @@ angular.module('ui.bootstrap.dropdown', [])
|
|
1741
1756
|
|
1742
1757
|
.directive('dropdownToggle', function() {
|
1743
1758
|
return {
|
1744
|
-
restrict: 'CA',
|
1745
1759
|
require: '?^dropdown',
|
1746
1760
|
link: function(scope, element, attrs, dropdownCtrl) {
|
1747
1761
|
if ( !dropdownCtrl ) {
|
@@ -1874,7 +1888,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
|
|
1874
1888
|
|
1875
1889
|
/**
|
1876
1890
|
* Auto-focusing of a freshly-opened modal element causes any child elements
|
1877
|
-
* with the autofocus attribute to
|
1891
|
+
* with the autofocus attribute to lose focus. This is an issue on touch
|
1878
1892
|
* based devices which will show and then hide the onscreen keyboard.
|
1879
1893
|
* Attempts to refocus the autofocus element via JavaScript will not reopen
|
1880
1894
|
* the onscreen keyboard. Fixed by updated the focusing logic to only autofocus
|
@@ -2472,7 +2486,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2472
2486
|
* Returns the actual instance of the $tooltip service.
|
2473
2487
|
* TODO support multiple triggers
|
2474
2488
|
*/
|
2475
|
-
this.$get = [ '$window', '$compile', '$timeout', '$
|
2489
|
+
this.$get = [ '$window', '$compile', '$timeout', '$document', '$position', '$interpolate', function ( $window, $compile, $timeout, $document, $position, $interpolate ) {
|
2476
2490
|
return function $tooltip ( type, prefix, defaultTriggerShow ) {
|
2477
2491
|
var options = angular.extend( {}, defaultOptions, globalOptions );
|
2478
2492
|
|
@@ -2505,31 +2519,32 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2505
2519
|
var endSym = $interpolate.endSymbol();
|
2506
2520
|
var template =
|
2507
2521
|
'<div '+ directiveName +'-popup '+
|
2508
|
-
'title="'+startSym+'
|
2509
|
-
'content="'+startSym+'
|
2510
|
-
'placement="'+startSym+'
|
2511
|
-
'animation="
|
2512
|
-
'is-open="
|
2522
|
+
'title="'+startSym+'title'+endSym+'" '+
|
2523
|
+
'content="'+startSym+'content'+endSym+'" '+
|
2524
|
+
'placement="'+startSym+'placement'+endSym+'" '+
|
2525
|
+
'animation="animation" '+
|
2526
|
+
'is-open="isOpen"'+
|
2513
2527
|
'>'+
|
2514
2528
|
'</div>';
|
2515
2529
|
|
2516
2530
|
return {
|
2517
2531
|
restrict: 'EA',
|
2518
|
-
scope: true,
|
2519
2532
|
compile: function (tElem, tAttrs) {
|
2520
2533
|
var tooltipLinker = $compile( template );
|
2521
2534
|
|
2522
2535
|
return function link ( scope, element, attrs ) {
|
2523
2536
|
var tooltip;
|
2537
|
+
var tooltipLinkedScope;
|
2524
2538
|
var transitionTimeout;
|
2525
2539
|
var popupTimeout;
|
2526
2540
|
var appendToBody = angular.isDefined( options.appendToBody ) ? options.appendToBody : false;
|
2527
2541
|
var triggers = getTriggers( undefined );
|
2528
2542
|
var hasEnableExp = angular.isDefined(attrs[prefix+'Enable']);
|
2543
|
+
var ttScope = scope.$new(true);
|
2529
2544
|
|
2530
2545
|
var positionTooltip = function () {
|
2531
2546
|
|
2532
|
-
var ttPosition = $position.positionElements(element, tooltip,
|
2547
|
+
var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);
|
2533
2548
|
ttPosition.top += 'px';
|
2534
2549
|
ttPosition.left += 'px';
|
2535
2550
|
|
@@ -2539,10 +2554,10 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2539
2554
|
|
2540
2555
|
// By default, the tooltip is not open.
|
2541
2556
|
// TODO add ability to start tooltip opened
|
2542
|
-
|
2557
|
+
ttScope.isOpen = false;
|
2543
2558
|
|
2544
2559
|
function toggleTooltipBind () {
|
2545
|
-
if ( !
|
2560
|
+
if ( ! ttScope.isOpen ) {
|
2546
2561
|
showTooltipBind();
|
2547
2562
|
} else {
|
2548
2563
|
hideTooltipBind();
|
@@ -2554,11 +2569,14 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2554
2569
|
if(hasEnableExp && !scope.$eval(attrs[prefix+'Enable'])) {
|
2555
2570
|
return;
|
2556
2571
|
}
|
2557
|
-
|
2572
|
+
|
2573
|
+
prepareTooltip();
|
2574
|
+
|
2575
|
+
if ( ttScope.popupDelay ) {
|
2558
2576
|
// Do nothing if the tooltip was already scheduled to pop-up.
|
2559
2577
|
// This happens if show is triggered multiple times before any hide is triggered.
|
2560
2578
|
if (!popupTimeout) {
|
2561
|
-
popupTimeout = $timeout( show,
|
2579
|
+
popupTimeout = $timeout( show, ttScope.popupDelay, false );
|
2562
2580
|
popupTimeout.then(function(reposition){reposition();});
|
2563
2581
|
}
|
2564
2582
|
} else {
|
@@ -2585,7 +2603,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2585
2603
|
}
|
2586
2604
|
|
2587
2605
|
// Don't show empty tooltips.
|
2588
|
-
if ( !
|
2606
|
+
if ( ! ttScope.content ) {
|
2589
2607
|
return angular.noop;
|
2590
2608
|
}
|
2591
2609
|
|
@@ -2594,7 +2612,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2594
2612
|
// Set the initial positioning.
|
2595
2613
|
tooltip.css({ top: 0, left: 0, display: 'block' });
|
2596
2614
|
|
2597
|
-
// Now we add it to the DOM because need some info about it. But it's not
|
2615
|
+
// Now we add it to the DOM because need some info about it. But it's not
|
2598
2616
|
// visible yet anyway.
|
2599
2617
|
if ( appendToBody ) {
|
2600
2618
|
$document.find( 'body' ).append( tooltip );
|
@@ -2605,8 +2623,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2605
2623
|
positionTooltip();
|
2606
2624
|
|
2607
2625
|
// And show the tooltip.
|
2608
|
-
|
2609
|
-
|
2626
|
+
ttScope.isOpen = true;
|
2627
|
+
ttScope.$digest(); // digest required as $apply is not called
|
2610
2628
|
|
2611
2629
|
// Return positioning function as promise callback for correct
|
2612
2630
|
// positioning after draw.
|
@@ -2616,16 +2634,16 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2616
2634
|
// Hide the tooltip popup element.
|
2617
2635
|
function hide() {
|
2618
2636
|
// First things first: we don't show it anymore.
|
2619
|
-
|
2637
|
+
ttScope.isOpen = false;
|
2620
2638
|
|
2621
2639
|
//if tooltip is going to be shown after delay, we must cancel this
|
2622
2640
|
$timeout.cancel( popupTimeout );
|
2623
2641
|
popupTimeout = null;
|
2624
2642
|
|
2625
|
-
// And now we remove it from the DOM. However, if we have animation, we
|
2643
|
+
// And now we remove it from the DOM. However, if we have animation, we
|
2626
2644
|
// need to wait for it to expire beforehand.
|
2627
2645
|
// FIXME: this is a placeholder for a port of the transitions library.
|
2628
|
-
if (
|
2646
|
+
if ( ttScope.animation ) {
|
2629
2647
|
if (!transitionTimeout) {
|
2630
2648
|
transitionTimeout = $timeout(removeTooltip, 500);
|
2631
2649
|
}
|
@@ -2639,10 +2657,8 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2639
2657
|
if (tooltip) {
|
2640
2658
|
removeTooltip();
|
2641
2659
|
}
|
2642
|
-
|
2643
|
-
|
2644
|
-
// Get contents rendered into the tooltip
|
2645
|
-
scope.$digest();
|
2660
|
+
tooltipLinkedScope = ttScope.$new();
|
2661
|
+
tooltip = tooltipLinker(tooltipLinkedScope, angular.noop);
|
2646
2662
|
}
|
2647
2663
|
|
2648
2664
|
function removeTooltip() {
|
@@ -2651,38 +2667,50 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2651
2667
|
tooltip.remove();
|
2652
2668
|
tooltip = null;
|
2653
2669
|
}
|
2670
|
+
if (tooltipLinkedScope) {
|
2671
|
+
tooltipLinkedScope.$destroy();
|
2672
|
+
tooltipLinkedScope = null;
|
2673
|
+
}
|
2674
|
+
}
|
2675
|
+
|
2676
|
+
function prepareTooltip() {
|
2677
|
+
prepPlacement();
|
2678
|
+
prepPopupDelay();
|
2654
2679
|
}
|
2655
2680
|
|
2656
2681
|
/**
|
2657
2682
|
* Observe the relevant attributes.
|
2658
2683
|
*/
|
2659
2684
|
attrs.$observe( type, function ( val ) {
|
2660
|
-
|
2685
|
+
ttScope.content = val;
|
2661
2686
|
|
2662
|
-
if (!val &&
|
2687
|
+
if (!val && ttScope.isOpen ) {
|
2663
2688
|
hide();
|
2664
2689
|
}
|
2665
2690
|
});
|
2666
2691
|
|
2667
2692
|
attrs.$observe( prefix+'Title', function ( val ) {
|
2668
|
-
|
2693
|
+
ttScope.title = val;
|
2669
2694
|
});
|
2670
2695
|
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2696
|
+
function prepPlacement() {
|
2697
|
+
var val = attrs[ prefix + 'Placement' ];
|
2698
|
+
ttScope.placement = angular.isDefined( val ) ? val : options.placement;
|
2699
|
+
}
|
2674
2700
|
|
2675
|
-
|
2701
|
+
function prepPopupDelay() {
|
2702
|
+
var val = attrs[ prefix + 'PopupDelay' ];
|
2676
2703
|
var delay = parseInt( val, 10 );
|
2677
|
-
|
2678
|
-
}
|
2704
|
+
ttScope.popupDelay = ! isNaN(delay) ? delay : options.popupDelay;
|
2705
|
+
}
|
2679
2706
|
|
2680
2707
|
var unregisterTriggers = function () {
|
2681
2708
|
element.unbind(triggers.show, showTooltipBind);
|
2682
2709
|
element.unbind(triggers.hide, hideTooltipBind);
|
2683
2710
|
};
|
2684
2711
|
|
2685
|
-
|
2712
|
+
function prepTriggers() {
|
2713
|
+
var val = attrs[ prefix + 'Trigger' ];
|
2686
2714
|
unregisterTriggers();
|
2687
2715
|
|
2688
2716
|
triggers = getTriggers( val );
|
@@ -2693,21 +2721,21 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2693
2721
|
element.bind( triggers.show, showTooltipBind );
|
2694
2722
|
element.bind( triggers.hide, hideTooltipBind );
|
2695
2723
|
}
|
2696
|
-
}
|
2724
|
+
}
|
2725
|
+
prepTriggers();
|
2697
2726
|
|
2698
2727
|
var animation = scope.$eval(attrs[prefix + 'Animation']);
|
2699
|
-
|
2728
|
+
ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation;
|
2700
2729
|
|
2701
|
-
|
2702
|
-
|
2703
|
-
});
|
2730
|
+
var appendToBodyVal = scope.$eval(attrs[prefix + 'AppendToBody']);
|
2731
|
+
appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;
|
2704
2732
|
|
2705
2733
|
// if a tooltip is attached to <body> we need to remove it on
|
2706
2734
|
// location change as its parent scope will probably not be destroyed
|
2707
2735
|
// by the change.
|
2708
2736
|
if ( appendToBody ) {
|
2709
2737
|
scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess () {
|
2710
|
-
if (
|
2738
|
+
if ( ttScope.isOpen ) {
|
2711
2739
|
hide();
|
2712
2740
|
}
|
2713
2741
|
});
|
@@ -2719,6 +2747,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
|
|
2719
2747
|
$timeout.cancel( popupTimeout );
|
2720
2748
|
unregisterTriggers();
|
2721
2749
|
removeTooltip();
|
2750
|
+
ttScope = null;
|
2722
2751
|
});
|
2723
2752
|
};
|
2724
2753
|
}
|
@@ -2976,14 +3005,19 @@ angular.module('ui.bootstrap.tabs', [])
|
|
2976
3005
|
|
2977
3006
|
ctrl.removeTab = function removeTab(tab) {
|
2978
3007
|
var index = tabs.indexOf(tab);
|
2979
|
-
//Select a new tab if the tab to be removed is selected
|
2980
|
-
if (tab.active && tabs.length > 1) {
|
3008
|
+
//Select a new tab if the tab to be removed is selected and not destroyed
|
3009
|
+
if (tab.active && tabs.length > 1 && !destroyed) {
|
2981
3010
|
//If this is the last tab, select the previous tab. else, the next tab.
|
2982
3011
|
var newActiveIndex = index == tabs.length - 1 ? index - 1 : index + 1;
|
2983
3012
|
ctrl.select(tabs[newActiveIndex]);
|
2984
3013
|
}
|
2985
3014
|
tabs.splice(index, 1);
|
2986
3015
|
};
|
3016
|
+
|
3017
|
+
var destroyed;
|
3018
|
+
$scope.$on('$destroy', function() {
|
3019
|
+
destroyed = true;
|
3020
|
+
});
|
2987
3021
|
}])
|
2988
3022
|
|
2989
3023
|
/**
|
@@ -3528,6 +3562,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3528
3562
|
|
3529
3563
|
var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false;
|
3530
3564
|
|
3565
|
+
var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false;
|
3566
|
+
|
3531
3567
|
//INTERNAL VARIABLES
|
3532
3568
|
|
3533
3569
|
//model setter executed upon match selection
|
@@ -3600,7 +3636,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3600
3636
|
if (onCurrentRequest && hasFocus) {
|
3601
3637
|
if (matches.length > 0) {
|
3602
3638
|
|
3603
|
-
scope.activeIdx = 0;
|
3639
|
+
scope.activeIdx = focusFirst ? 0 : -1;
|
3604
3640
|
scope.matches.length = 0;
|
3605
3641
|
|
3606
3642
|
//transform labels
|
@@ -3694,7 +3730,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3694
3730
|
|
3695
3731
|
if (inputFormatter) {
|
3696
3732
|
|
3697
|
-
locals
|
3733
|
+
locals.$model = modelValue;
|
3698
3734
|
return inputFormatter(originalScope, locals);
|
3699
3735
|
|
3700
3736
|
} else {
|
@@ -3741,6 +3777,11 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3741
3777
|
return;
|
3742
3778
|
}
|
3743
3779
|
|
3780
|
+
// if there's nothing selected (i.e. focusFirst) and enter is hit, don't do anything
|
3781
|
+
if (scope.activeIdx == -1 && (evt.which === 13 || evt.which === 9)) {
|
3782
|
+
return;
|
3783
|
+
}
|
3784
|
+
|
3744
3785
|
evt.preventDefault();
|
3745
3786
|
|
3746
3787
|
if (evt.which === 40) {
|
@@ -3748,7 +3789,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3748
3789
|
scope.$digest();
|
3749
3790
|
|
3750
3791
|
} else if (evt.which === 38) {
|
3751
|
-
scope.activeIdx = (scope.activeIdx ? scope.activeIdx : scope.matches.length) - 1;
|
3792
|
+
scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
|
3752
3793
|
scope.$digest();
|
3753
3794
|
|
3754
3795
|
} else if (evt.which === 13 || evt.which === 9) {
|
@@ -3780,10 +3821,13 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
|
|
3780
3821
|
|
3781
3822
|
originalScope.$on('$destroy', function(){
|
3782
3823
|
$document.unbind('click', dismissClickHandler);
|
3824
|
+
if (appendToBody) {
|
3825
|
+
$popup.remove();
|
3826
|
+
}
|
3783
3827
|
});
|
3784
3828
|
|
3785
3829
|
var $popup = $compile(popUpEl)(scope);
|
3786
|
-
if (
|
3830
|
+
if (appendToBody) {
|
3787
3831
|
$document.find('body').append($popup);
|
3788
3832
|
} else {
|
3789
3833
|
element.after($popup);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-ui-bootstrap-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Constantin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Injects Angular.js UI Bootstrap directives into your asset pipeline.
|
14
14
|
email: chris@chrisconstantin.net
|