|
1 | 1 | /*@preserve |
2 | | - * Tempus Dominus Bootstrap4 v5.0.0-alpha14 (https://tempusdominus.github.io/bootstrap-4/) |
3 | | - * Copyright 2016-2017 Jonathan Peterson |
| 2 | + * Tempus Dominus Bootstrap4 v5.0.0-alpha15 (https://tempusdominus.github.io/bootstrap-4/) |
| 3 | + * Copyright 2016-2018 Jonathan Peterson |
4 | 4 | * Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE) |
5 | 5 | */ |
6 | 6 |
|
@@ -1632,10 +1632,9 @@ var TempusDominusBootstrap4 = function ($) { |
1632 | 1632 |
|
1633 | 1633 | TempusDominusBootstrap4.prototype._init = function _init() { |
1634 | 1634 | if (this._element.hasClass('input-group')) { |
1635 | | - // in case there is more then one 'input-group-addon' Issue #48 |
1636 | 1635 | var datepickerButton = this._element.find('.datepickerbutton'); |
1637 | 1636 | if (datepickerButton.length === 0) { |
1638 | | - this.component = this._element.find('.input-group-append'); |
| 1637 | + this.component = this._element.find('[data-toggle="datetimepicker"]'); |
1639 | 1638 | } else { |
1640 | 1639 | this.component = datepickerButton; |
1641 | 1640 | } |
@@ -1749,24 +1748,32 @@ var TempusDominusBootstrap4 = function ($) { |
1749 | 1748 | var row = []; |
1750 | 1749 | if (this._options.buttons.showToday) { |
1751 | 1750 | row.push($('<td>').append($('<a>').attr({ |
| 1751 | + href: '#', |
| 1752 | + tabindex: '-1', |
1752 | 1753 | 'data-action': 'today', |
1753 | 1754 | 'title': this._options.tooltips.today |
1754 | 1755 | }).append($('<span>').addClass(this._options.icons.today)))); |
1755 | 1756 | } |
1756 | 1757 | if (!this._options.sideBySide && this._hasDate() && this._hasTime()) { |
1757 | 1758 | row.push($('<td>').append($('<a>').attr({ |
| 1759 | + href: '#', |
| 1760 | + tabindex: '-1', |
1758 | 1761 | 'data-action': 'togglePicker', |
1759 | 1762 | 'title': this._options.tooltips.selectTime |
1760 | 1763 | }).append($('<span>').addClass(this._options.icons.time)))); |
1761 | 1764 | } |
1762 | 1765 | if (this._options.buttons.showClear) { |
1763 | 1766 | row.push($('<td>').append($('<a>').attr({ |
| 1767 | + href: '#', |
| 1768 | + tabindex: '-1', |
1764 | 1769 | 'data-action': 'clear', |
1765 | 1770 | 'title': this._options.tooltips.clear |
1766 | 1771 | }).append($('<span>').addClass(this._options.icons.clear)))); |
1767 | 1772 | } |
1768 | 1773 | if (this._options.buttons.showClose) { |
1769 | 1774 | row.push($('<td>').append($('<a>').attr({ |
| 1775 | + href: '#', |
| 1776 | + tabindex: '-1', |
1770 | 1777 | 'data-action': 'close', |
1771 | 1778 | 'title': this._options.tooltips.close |
1772 | 1779 | }).append($('<span>').addClass(this._options.icons.close)))); |
@@ -2405,20 +2412,35 @@ var TempusDominusBootstrap4 = function ($) { |
2405 | 2412 | } |
2406 | 2413 | } |
2407 | 2414 | this._setValue(lastPicked.clone().hours(hour), this._getLastPickedDateIndex()); |
2408 | | - this._doAction(e, 'showPicker'); |
| 2415 | + if (!this._isEnabled('m') && !this._options.keepOpen && !this._options.inline) { |
| 2416 | + this.hide(); |
| 2417 | + } else { |
| 2418 | + this._doAction(e, 'showPicker'); |
| 2419 | + } |
2409 | 2420 | break; |
2410 | 2421 | } |
2411 | 2422 | case 'selectMinute': |
2412 | 2423 | this._setValue(lastPicked.clone().minutes(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex()); |
2413 | | - this._doAction(e, 'showPicker'); |
| 2424 | + if (!this._isEnabled('s') && !this._options.keepOpen && !this._options.inline) { |
| 2425 | + this.hide(); |
| 2426 | + } else { |
| 2427 | + this._doAction(e, 'showPicker'); |
| 2428 | + } |
2414 | 2429 | break; |
2415 | 2430 | case 'selectSecond': |
2416 | 2431 | this._setValue(lastPicked.clone().seconds(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex()); |
2417 | | - this._doAction(e, 'showPicker'); |
| 2432 | + if (!this._options.keepOpen && !this._options.inline) { |
| 2433 | + this.hide(); |
| 2434 | + } else { |
| 2435 | + this._doAction(e, 'showPicker'); |
| 2436 | + } |
2418 | 2437 | break; |
2419 | 2438 | case 'clear': |
2420 | 2439 | this.clear(); |
2421 | 2440 | break; |
| 2441 | + case 'close': |
| 2442 | + this.hide(); |
| 2443 | + break; |
2422 | 2444 | case 'today': |
2423 | 2445 | { |
2424 | 2446 | var todaysDate = this.getMoment(); |
|
0 commit comments