@finqu/cool 1.2.27 → 1.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/cool-grid.css +703 -17
- package/dist/css/cool-grid.css.map +3 -3
- package/dist/css/cool-grid.min.css +1 -1
- package/dist/css/cool-grid.min.css.map +1 -1
- package/dist/css/cool-reboot.css +16 -15
- package/dist/css/cool-reboot.css.map +7 -7
- package/dist/css/cool-reboot.min.css +1 -1
- package/dist/css/cool-reboot.min.css.map +1 -1
- package/dist/css/cool.css +2663 -2160
- package/dist/css/cool.css.map +30 -30
- package/dist/css/cool.min.css +1 -1
- package/dist/css/cool.min.css.map +1 -1
- package/dist/js/cool.bundle.js +142 -116
- package/dist/js/cool.bundle.js.map +1 -1
- package/dist/js/cool.bundle.min.js +3 -3
- package/dist/js/cool.bundle.min.js.map +1 -1
- package/dist/js/cool.esm.js +142 -116
- package/dist/js/cool.esm.js.map +1 -1
- package/dist/js/cool.esm.min.js +3 -3
- package/dist/js/cool.esm.min.js.map +1 -1
- package/dist/js/cool.js +142 -116
- package/dist/js/cool.js.map +1 -1
- package/dist/js/cool.min.js +3 -3
- package/dist/js/cool.min.js.map +1 -1
- package/html/index.html +41 -42
- package/js/dist/collapse.js +912 -667
- package/js/dist/collapse.js.map +1 -1
- package/js/dist/common.js +1211 -1367
- package/js/dist/common.js.map +1 -1
- package/js/dist/dropdown.js +2 -2
- package/js/dist/popover.js +1784 -1610
- package/js/dist/popover.js.map +1 -1
- package/js/dist/sectiontabs.js +2 -2
- package/js/dist/select.js +3330 -3302
- package/js/dist/select.js.map +1 -1
- package/js/dist/tooltip.js +1708 -1594
- package/js/dist/tooltip.js.map +1 -1
- package/js/src/collapse.js +44 -30
- package/js/src/common.js +60 -77
- package/js/src/dialog.js +3 -2
- package/js/src/popover.js +15 -4
- package/js/src/select.js +7 -6
- package/js/src/tooltip.js +15 -9
- package/package.json +1 -1
- package/scss/_alert.scss +26 -30
- package/scss/_badge.scss +44 -13
- package/scss/_buttons.scss +60 -19
- package/scss/_custom-forms.scss +51 -36
- package/scss/_dialog.scss +15 -16
- package/scss/_dropdown.scss +2 -0
- package/scss/_forms.scss +2 -1
- package/scss/_frame.scss +310 -231
- package/scss/_functions.scss +1 -1
- package/scss/_images.scss +51 -52
- package/scss/_input-group.scss +35 -21
- package/scss/_navbar.scss +30 -4
- package/scss/_pagination.scss +25 -16
- package/scss/_popover.scss +3 -1
- package/scss/_reboot.scss +5 -4
- package/scss/_root.scss +3 -3
- package/scss/_section.scss +162 -97
- package/scss/_select.scss +12 -0
- package/scss/_tables.scss +55 -36
- package/scss/_tabs.scss +29 -26
- package/scss/_type.scss +9 -1
- package/scss/_variables.scss +376 -252
- package/scss/mixins/_alert-variant.scss +6 -11
- package/scss/mixins/_badge-variant.scss +2 -2
- package/scss/mixins/_gradients.scss +5 -5
- package/scss/utilities/_background.scss +3 -3
- package/scss/utilities/_borders.scss +5 -5
- package/scss/utilities/_placeholder.scss +6 -5
- package/scss/utilities/_text.scss +3 -3
- package/html/dropdown-test.html +0 -200
package/dist/js/cool.bundle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cool UI v1.2.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Cool UI v1.2.29 (https://finqu.fi)
|
|
3
|
+
* Copyright 2011-2021 Finqu Oy
|
|
4
4
|
* Licensed under the ISC license - (http://opensource.org/licenses/ISC)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -1265,6 +1265,19 @@
|
|
|
1265
1265
|
function () {
|
|
1266
1266
|
function Common() {}
|
|
1267
1267
|
|
|
1268
|
+
Common.refresh = function refresh() {
|
|
1269
|
+
$('.form-label-group').each(function (i, formLabelGroup) {
|
|
1270
|
+
var $formLabelGroup = $(formLabelGroup);
|
|
1271
|
+
var val = $formLabelGroup.find('input, select').val();
|
|
1272
|
+
|
|
1273
|
+
if (val) {
|
|
1274
|
+
$(formLabelGroup).addClass('label-on-top');
|
|
1275
|
+
} else {
|
|
1276
|
+
$(formLabelGroup).removeClass('label-on-top');
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1268
1281
|
Common.initialize = function initialize(opts) {
|
|
1269
1282
|
// There's an error if opts is not defined
|
|
1270
1283
|
opts = opts || {}; // Save settings for later use
|
|
@@ -1300,19 +1313,26 @@
|
|
|
1300
1313
|
$inputGroup.removeClass('input-group-focus');
|
|
1301
1314
|
}
|
|
1302
1315
|
}
|
|
1303
|
-
});
|
|
1316
|
+
});
|
|
1317
|
+
$(document).on('blur input change', '.form-label-group', function () {
|
|
1318
|
+
var $formLabelGroup = $(this);
|
|
1319
|
+
var val = $formLabelGroup.find('input, select').val();
|
|
1304
1320
|
|
|
1321
|
+
if (val) {
|
|
1322
|
+
$(this).addClass('label-on-top');
|
|
1323
|
+
} else {
|
|
1324
|
+
$(this).removeClass('label-on-top');
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1305
1327
|
$('.form-label-group').each(function (i, formLabelGroup) {
|
|
1306
1328
|
var $formLabelGroup = $(formLabelGroup);
|
|
1307
|
-
$formLabelGroup.find('input').
|
|
1308
|
-
var val = $(this).val();
|
|
1329
|
+
var val = $formLabelGroup.find('input, select').val();
|
|
1309
1330
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
}).trigger('change');
|
|
1331
|
+
if (val) {
|
|
1332
|
+
$(formLabelGroup).addClass('label-on-top');
|
|
1333
|
+
} else {
|
|
1334
|
+
$(formLabelGroup).removeClass('label-on-top');
|
|
1335
|
+
}
|
|
1316
1336
|
}); // Table actions
|
|
1317
1337
|
|
|
1318
1338
|
$.each($('.table'), function () {
|
|
@@ -1320,71 +1340,43 @@
|
|
|
1320
1340
|
$(this).addClass('table-hover');
|
|
1321
1341
|
}
|
|
1322
1342
|
});
|
|
1343
|
+
$(document).on('click', '[data-table-link] .table-link-exclude, [data-table-link] input, [data-table-link] button, [data-table-link] a, [data-table-link] label, [data-table-link] .td-col-select', function (e) {
|
|
1344
|
+
e.stopPropagation();
|
|
1345
|
+
});
|
|
1323
1346
|
$(document).on('click', '[data-table-link]', function (e) {
|
|
1324
1347
|
var $container = $(this).parents('table, .table');
|
|
1325
1348
|
var href = $(this).data('tableLink');
|
|
1326
|
-
var target = $(e.target);
|
|
1327
|
-
var exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
|
|
1328
|
-
var linkDisabled = false;
|
|
1329
|
-
$.each(exceptions, function (item) {
|
|
1330
|
-
if (target.is(item) || item == 'a' && target.parent().is(item)) {
|
|
1331
|
-
linkDisabled = true;
|
|
1332
|
-
}
|
|
1333
|
-
});
|
|
1334
1349
|
|
|
1335
1350
|
if ($container.hasClass('bulk-actions-active')) {
|
|
1336
|
-
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
if (target.hasClass('table-link-exclude')) {
|
|
1340
|
-
linkDisabled = true;
|
|
1351
|
+
return;
|
|
1341
1352
|
}
|
|
1342
1353
|
|
|
1343
|
-
if (
|
|
1344
|
-
|
|
1345
|
-
window.open(href, '_blank');
|
|
1346
|
-
} else {
|
|
1347
|
-
window.location.href = href;
|
|
1348
|
-
}
|
|
1354
|
+
if (e.ctrlKey || e.metaKey) {
|
|
1355
|
+
window.open(href, '_blank');
|
|
1349
1356
|
} else {
|
|
1350
|
-
|
|
1357
|
+
window.location.href = href;
|
|
1351
1358
|
}
|
|
1352
1359
|
});
|
|
1360
|
+
$(document).on('click', '[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select', function (e) {
|
|
1361
|
+
e.stopPropagation();
|
|
1362
|
+
});
|
|
1353
1363
|
$(document).on('click', '[data-table-btn]', function (e) {
|
|
1354
1364
|
var $container = $(this).parents('table, .table');
|
|
1355
|
-
var $self = $(this);
|
|
1356
1365
|
var btn = $(this).data('tableButton');
|
|
1357
|
-
var target = $(e.target);
|
|
1358
|
-
var exceptions = ['input', 'button', 'a', 'label', 'td.col-select'];
|
|
1359
|
-
var btnDisabled = false;
|
|
1360
1366
|
|
|
1361
1367
|
if (!btn) {
|
|
1362
|
-
btn = $
|
|
1368
|
+
btn = $container.find('button')[0];
|
|
1363
1369
|
|
|
1364
1370
|
if (!btn) {
|
|
1365
1371
|
return;
|
|
1366
1372
|
}
|
|
1367
1373
|
}
|
|
1368
1374
|
|
|
1369
|
-
$.each(exceptions, function (item) {
|
|
1370
|
-
if (target.is(item) || item == 'a' && target.parent().is(item)) {
|
|
1371
|
-
btnDisabled = true;
|
|
1372
|
-
}
|
|
1373
|
-
});
|
|
1374
|
-
|
|
1375
1375
|
if ($container.hasClass('bulk-actions-active')) {
|
|
1376
|
-
btnDisabled = true;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
if (target.hasClass('table-btn-exclude')) {
|
|
1380
|
-
btnDisabled = true;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
if (target.is('td, .td, img') && !btnDisabled) {
|
|
1384
|
-
$(btn).click();
|
|
1385
|
-
} else {
|
|
1386
1376
|
return;
|
|
1387
1377
|
}
|
|
1378
|
+
|
|
1379
|
+
$(btn).click();
|
|
1388
1380
|
}); // button toggle
|
|
1389
1381
|
|
|
1390
1382
|
$(document).on('click', '.btn-group-toggle .btn > input', function (e) {
|
|
@@ -1444,10 +1436,18 @@
|
|
|
1444
1436
|
minScrollbarLength: 20,
|
|
1445
1437
|
suppressScrollX: true
|
|
1446
1438
|
});
|
|
1447
|
-
$sidebarLeftContent.find('[data-toggle="collapse"]').on('click', function () {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1439
|
+
$sidebarLeftContent.find('[data-toggle="collapse"]').on('click', function (e) {
|
|
1440
|
+
if ($(this).data('breakpoint') && window.matchMedia("(min-width: " + $(this).data('breakpoint') + "px)").matches) {
|
|
1441
|
+
var a = $(this).next().find('li').first().children('a').first();
|
|
1442
|
+
|
|
1443
|
+
if (a) {
|
|
1444
|
+
window.location.href = a.attr('href');
|
|
1445
|
+
}
|
|
1446
|
+
} else {
|
|
1447
|
+
setTimeout(function () {
|
|
1448
|
+
sidebarLeftScroll.update();
|
|
1449
|
+
}, 300);
|
|
1450
|
+
}
|
|
1451
1451
|
});
|
|
1452
1452
|
} // Sidebar tabs
|
|
1453
1453
|
|
|
@@ -1500,6 +1500,7 @@
|
|
|
1500
1500
|
}();
|
|
1501
1501
|
|
|
1502
1502
|
window.Cool.initialize = Common.initialize;
|
|
1503
|
+
window.Cool.refresh = Common.refresh;
|
|
1503
1504
|
|
|
1504
1505
|
function _inheritsLoose(subClass, superClass) {
|
|
1505
1506
|
subClass.prototype = Object.create(superClass.prototype);
|
|
@@ -1713,9 +1714,11 @@
|
|
|
1713
1714
|
this.$el.on('mouseenter' + '.' + NAME, function () {
|
|
1714
1715
|
_this2.show();
|
|
1715
1716
|
});
|
|
1716
|
-
this.$el.on('mouseleave' + '.' + NAME, function () {
|
|
1717
|
-
_this2.
|
|
1718
|
-
|
|
1717
|
+
this.$el.on('mouseleave' + '.' + NAME, debounce(function () {
|
|
1718
|
+
if (!_this2.popupHasFocus) {
|
|
1719
|
+
_this2.close();
|
|
1720
|
+
}
|
|
1721
|
+
}, 500));
|
|
1719
1722
|
} else if (this.trigger === 'focus') {
|
|
1720
1723
|
this.$el.on('focusin' + '.' + NAME, function () {
|
|
1721
1724
|
_this2.show();
|
|
@@ -1750,6 +1753,8 @@
|
|
|
1750
1753
|
;
|
|
1751
1754
|
|
|
1752
1755
|
_proto.buildPopover = function buildPopover() {
|
|
1756
|
+
var _this3 = this;
|
|
1757
|
+
|
|
1753
1758
|
var content;
|
|
1754
1759
|
|
|
1755
1760
|
if (typeof this.content === 'function') {
|
|
@@ -1760,6 +1765,14 @@
|
|
|
1760
1765
|
|
|
1761
1766
|
this.$popover = $("\n \t\t<div class=\"popover\" role=\"tooltip\" id=\"" + this.id + "\">\n\n\t\t\t <div class=\"arrow\"></div>\n\n\t\t\t <h3 class=\"popover-header\">" + this.title + "</h3>\n\n\t\t\t <div class=\"popover-body\">" + content + "</div>\n\n\t\t\t</div>\n \t");
|
|
1762
1767
|
this.$container.append(this.$popover);
|
|
1768
|
+
this.$container.find('#' + this.id).on('mouseenter', function () {
|
|
1769
|
+
_this3.popupHasFocus = true;
|
|
1770
|
+
});
|
|
1771
|
+
this.$container.find('#' + this.id).on('mouseleave', function () {
|
|
1772
|
+
_this3.popupHasFocus = false;
|
|
1773
|
+
|
|
1774
|
+
_this3.close();
|
|
1775
|
+
});
|
|
1763
1776
|
this.$arrow = this.$popover.find('.arrow') ? this.$popover.find('.arrow') : false;
|
|
1764
1777
|
this.log(this.$el);
|
|
1765
1778
|
this.log(this.$container);
|
|
@@ -2056,7 +2069,7 @@
|
|
|
2056
2069
|
;
|
|
2057
2070
|
|
|
2058
2071
|
_proto.close = function close() {
|
|
2059
|
-
var
|
|
2072
|
+
var _this4 = this;
|
|
2060
2073
|
|
|
2061
2074
|
if (!this.$popover) {
|
|
2062
2075
|
return;
|
|
@@ -2064,14 +2077,14 @@
|
|
|
2064
2077
|
|
|
2065
2078
|
if (this.animation && !this.$popover.hasClass('animated')) {
|
|
2066
2079
|
this.$popover.animateCss(this.animationOut, function () {
|
|
2067
|
-
|
|
2080
|
+
_this4.$popover.remove();
|
|
2068
2081
|
|
|
2069
|
-
|
|
2082
|
+
_this4.$el.removeAttr('data-popover');
|
|
2070
2083
|
|
|
2071
|
-
|
|
2072
|
-
|
|
2084
|
+
_this4.$popover = null;
|
|
2085
|
+
_this4.placementChanged = false;
|
|
2073
2086
|
|
|
2074
|
-
|
|
2087
|
+
_this4.onClose();
|
|
2075
2088
|
});
|
|
2076
2089
|
} else {
|
|
2077
2090
|
this.$popover.remove();
|
|
@@ -2206,13 +2219,14 @@
|
|
|
2206
2219
|
this.$select.find('.select-item').remove();
|
|
2207
2220
|
this.$selectItems = [];
|
|
2208
2221
|
this.$selectIconContainer.html(this.selectIconDefault);
|
|
2222
|
+
this.$selectHeader.removeClass('select-placeholder');
|
|
2209
2223
|
|
|
2210
2224
|
if (this.data[this.name].length == 0 && this.dynamicTitle && this.dynamicTitleDefault && this.dynamicTitleDefault !== 0 && this.$selectTitle.text().trim() == 0 && (this.$selectItems.length > 0 || this.searchApi)) {
|
|
2211
2225
|
this.$selectTitle.html(this.dynamicTitleDefault);
|
|
2212
2226
|
}
|
|
2213
2227
|
|
|
2214
2228
|
if (this.$selectItems.length == 0 && !this.searchApi && this.dynamicTitle && this.dynamicTitleEmptyDefault && this.dynamicTitleEmptyDefault !== 0) {
|
|
2215
|
-
this.$selectHeader.
|
|
2229
|
+
this.$selectHeader.addClass('select-placeholder');
|
|
2216
2230
|
this.$selectIconContainer.addClass('d-none');
|
|
2217
2231
|
this.$selectTitle.html(this.dynamicTitleEmptyDefault);
|
|
2218
2232
|
}
|
|
@@ -2349,12 +2363,14 @@
|
|
|
2349
2363
|
_this3.$scrollableContent = _this3.$select.find('.select-scrollable-content') ? _this3.$select.find('.select-scrollable-content') : false;
|
|
2350
2364
|
_this3.$selectItems = _this3.$select.find('.select-item');
|
|
2351
2365
|
|
|
2366
|
+
_this3.$selectHeader.removeClass('select-placeholder');
|
|
2367
|
+
|
|
2352
2368
|
if (_this3.data[_this3.name].length == 0 && _this3.dynamicTitle && _this3.dynamicTitleDefault && _this3.dynamicTitleDefault !== 0 && _this3.$selectTitle.text().trim() == 0 && (_this3.$selectItems.length > 0 || _this3.searchApi)) {
|
|
2353
2369
|
_this3.$selectTitle.html(_this3.dynamicTitleDefault);
|
|
2354
2370
|
}
|
|
2355
2371
|
|
|
2356
2372
|
if (_this3.$selectItems.length == 0 && !_this3.searchApi && _this3.dynamicTitle && _this3.dynamicTitleEmptyDefault && _this3.dynamicTitleEmptyDefault !== 0) {
|
|
2357
|
-
_this3.$selectHeader.
|
|
2373
|
+
_this3.$selectHeader.addClass('select-placeholder');
|
|
2358
2374
|
|
|
2359
2375
|
_this3.$selectIconContainer.addClass('d-none');
|
|
2360
2376
|
|
|
@@ -2628,7 +2644,7 @@
|
|
|
2628
2644
|
var faNameSpace = this.opts.faPro ? 'fal' : 'fas';
|
|
2629
2645
|
|
|
2630
2646
|
if (this.showValidStateIcon) {
|
|
2631
|
-
this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-
|
|
2647
|
+
this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-success icon\"></i>");
|
|
2632
2648
|
} else {
|
|
2633
2649
|
this.$selectIconContainer.html(this.selectIconDefault);
|
|
2634
2650
|
}
|
|
@@ -2894,7 +2910,7 @@
|
|
|
2894
2910
|
}, 300);
|
|
2895
2911
|
|
|
2896
2912
|
if (this.data[this.name].length > 0 && this.showValidStateIcon) {
|
|
2897
|
-
this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-
|
|
2913
|
+
this.$selectIconContainer.html("<i class=\"" + faNameSpace + " fa-check text-success icon\"></i>");
|
|
2898
2914
|
} else {
|
|
2899
2915
|
this.$selectIconContainer.html(this.selectIconDefault);
|
|
2900
2916
|
}
|
|
@@ -3145,7 +3161,7 @@
|
|
|
3145
3161
|
if (!this.showFooter) {
|
|
3146
3162
|
return '';
|
|
3147
3163
|
} else {
|
|
3148
|
-
return "\n\n <div class=\"select-footer\">\n\n <button class=\"btn btn-block btn-
|
|
3164
|
+
return "\n\n <div class=\"select-footer\">\n\n <button class=\"btn btn-block btn-light btn-sm\" type=\"button\" tabindex=\"-1\" data-select-close >\n " + this.btnCloseText + "\n </button>\n\n </div>\n\n ";
|
|
3149
3165
|
}
|
|
3150
3166
|
};
|
|
3151
3167
|
|
|
@@ -3768,21 +3784,25 @@
|
|
|
3768
3784
|
this.placement = this.$el.data('placement') ? this.$el.data('placement') : this.opts.placement;
|
|
3769
3785
|
this.placementChanged = false;
|
|
3770
3786
|
this.content = this.$el.data('content') ? this.$el.data('content') : this.opts.content;
|
|
3787
|
+
this.trigger = this.$el.data('trigger') ? this.$el.data('trigger') : this.opts.trigger;
|
|
3771
3788
|
} // Bind events that trigger methods
|
|
3772
3789
|
;
|
|
3773
3790
|
|
|
3774
3791
|
_proto.bindEvents = function bindEvents() {
|
|
3775
3792
|
var _this2 = this;
|
|
3776
3793
|
|
|
3777
|
-
this
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3794
|
+
if (this.trigger === 'auto') {
|
|
3795
|
+
this.$el.on('mouseenter' + '.' + NAME$3, function () {
|
|
3796
|
+
_this2.show();
|
|
3797
|
+
});
|
|
3798
|
+
this.$el.on('mouseleave' + '.' + NAME$3, function () {
|
|
3799
|
+
_this2.close();
|
|
3800
|
+
});
|
|
3801
|
+
this.$el.on('blur' + '.' + NAME$3, function () {
|
|
3802
|
+
_this2.close();
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3786
3806
|
this.$el.on('destroyed' + '.' + NAME$3, function () {
|
|
3787
3807
|
_this2.close();
|
|
3788
3808
|
});
|
|
@@ -3825,6 +3845,7 @@
|
|
|
3825
3845
|
this.log('Animation speed: ' + this.animationSpeed);
|
|
3826
3846
|
this.log('Placement: ' + this.placement);
|
|
3827
3847
|
this.log('Content: ' + this.content);
|
|
3848
|
+
this.log('Trigger: ' + this.trigger);
|
|
3828
3849
|
} // Set positions
|
|
3829
3850
|
;
|
|
3830
3851
|
|
|
@@ -4176,6 +4197,7 @@
|
|
|
4176
4197
|
animationSpeed: 'fastest',
|
|
4177
4198
|
placement: 'bottom',
|
|
4178
4199
|
content: '',
|
|
4200
|
+
trigger: 'auto',
|
|
4179
4201
|
onInit: null,
|
|
4180
4202
|
onUpdate: null,
|
|
4181
4203
|
onDestroy: null,
|
|
@@ -4428,7 +4450,9 @@
|
|
|
4428
4450
|
_proto.buildCache = function buildCache() {
|
|
4429
4451
|
this.$el = $(this.el);
|
|
4430
4452
|
this.$target = this.$el.data('target') ? $(document).find(this.$el.data('target')) : $(document).find(this.opts.target);
|
|
4453
|
+
this.breakpoint = this.$el.data('breakpoint');
|
|
4431
4454
|
this.expanded = this.$el.attr('aria-expanded') == 'true' ? true : false;
|
|
4455
|
+
this.transitionendEvent = this.whichTransitionEvent();
|
|
4432
4456
|
|
|
4433
4457
|
if (this.$target.length) {
|
|
4434
4458
|
this.targetHeight = this.$target.height();
|
|
@@ -4458,10 +4482,12 @@
|
|
|
4458
4482
|
var _this2 = this;
|
|
4459
4483
|
|
|
4460
4484
|
this.$el.on('click' + '.' + this.name, function (e) {
|
|
4461
|
-
if (_this2.
|
|
4462
|
-
_this2.
|
|
4463
|
-
|
|
4464
|
-
|
|
4485
|
+
if (!_this2.breakpoint || !window.matchMedia("(min-width: " + _this2.breakpoint + "px)").matches) {
|
|
4486
|
+
if (_this2.expanded) {
|
|
4487
|
+
_this2.close();
|
|
4488
|
+
} else {
|
|
4489
|
+
_this2.show();
|
|
4490
|
+
}
|
|
4465
4491
|
}
|
|
4466
4492
|
});
|
|
4467
4493
|
$(window).on('resize', debounce(function () {
|
|
@@ -4499,9 +4525,8 @@
|
|
|
4499
4525
|
;
|
|
4500
4526
|
|
|
4501
4527
|
_proto.show = function show() {
|
|
4502
|
-
var
|
|
4528
|
+
var self = this; // Update target height if something is added to dom which causes height to change
|
|
4503
4529
|
|
|
4504
|
-
// Update target height if something is added to dom which causes height to change
|
|
4505
4530
|
if (this.targetHeight !== this.$target.height()) {
|
|
4506
4531
|
this.targetHeight = this.$target.height();
|
|
4507
4532
|
}
|
|
@@ -4524,30 +4549,30 @@
|
|
|
4524
4549
|
this.$indicator.addClass('show');
|
|
4525
4550
|
}
|
|
4526
4551
|
|
|
4527
|
-
this.$target.
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
if (_this3.$el.is('button')) {
|
|
4531
|
-
_this3.$el.attr('disabled', false);
|
|
4532
|
-
}
|
|
4533
|
-
|
|
4534
|
-
_this3.$target.removeAttr('style');
|
|
4552
|
+
this.$target.on(this.transitionendEvent, function (e) {
|
|
4553
|
+
if ($(e.target).is(this)) {
|
|
4554
|
+
self.$target.removeClass('collapsing');
|
|
4535
4555
|
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
_this3.$target.css('height', 'auto');
|
|
4556
|
+
if (self.$el.is('button')) {
|
|
4557
|
+
self.$el.attr('disabled', false);
|
|
4558
|
+
}
|
|
4541
4559
|
|
|
4542
|
-
|
|
4560
|
+
self.$target.removeAttr('style');
|
|
4561
|
+
self.$target.addClass('collapse show');
|
|
4562
|
+
self.$el.attr('aria-expanded', true);
|
|
4563
|
+
self.$target.css('height', 'auto');
|
|
4564
|
+
self.expanded = true;
|
|
4565
|
+
$(this).off(self.transitionendEvent);
|
|
4566
|
+
}
|
|
4543
4567
|
});
|
|
4544
4568
|
this.onShow();
|
|
4545
4569
|
} // Close
|
|
4546
4570
|
;
|
|
4547
4571
|
|
|
4548
4572
|
_proto.close = function close() {
|
|
4549
|
-
var
|
|
4573
|
+
var _this3 = this;
|
|
4550
4574
|
|
|
4575
|
+
var self = this;
|
|
4551
4576
|
this.$target.removeClass('collapse show');
|
|
4552
4577
|
this.$target.addClass('collapsing');
|
|
4553
4578
|
|
|
@@ -4561,30 +4586,31 @@
|
|
|
4561
4586
|
|
|
4562
4587
|
this.$target.css('height', this.$target.height());
|
|
4563
4588
|
setTimeout(function () {
|
|
4564
|
-
|
|
4589
|
+
_this3.$target.css('height', 0);
|
|
4565
4590
|
}, 10);
|
|
4566
4591
|
|
|
4567
4592
|
if (this.$indicator.length && this.$indicator.hasClass('show')) {
|
|
4568
4593
|
this.$indicator.removeClass('show');
|
|
4569
4594
|
}
|
|
4570
4595
|
|
|
4571
|
-
this.$target.
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
if (_this4.$el.is('button')) {
|
|
4575
|
-
_this4.$el.attr('disabled', false);
|
|
4576
|
-
}
|
|
4577
|
-
|
|
4578
|
-
_this4.$target.removeAttr('style');
|
|
4596
|
+
this.$target.on(this.transitionendEvent, function (e) {
|
|
4597
|
+
if ($(e.target).is(this)) {
|
|
4598
|
+
self.$target.removeClass('collapsing');
|
|
4579
4599
|
|
|
4580
|
-
|
|
4600
|
+
if (self.$el.is('button')) {
|
|
4601
|
+
self.$el.attr('disabled', false);
|
|
4602
|
+
}
|
|
4581
4603
|
|
|
4582
|
-
|
|
4604
|
+
self.$target.removeAttr('style');
|
|
4605
|
+
self.$target.addClass('collapse');
|
|
4606
|
+
self.$el.attr('aria-expanded', false);
|
|
4607
|
+
self.expanded = false; // Update target height if something is added to dom which causes height to change
|
|
4583
4608
|
|
|
4584
|
-
|
|
4609
|
+
if (self.targetHeight !== self.$target.height()) {
|
|
4610
|
+
self.targetHeight = self.$target.height();
|
|
4611
|
+
}
|
|
4585
4612
|
|
|
4586
|
-
|
|
4587
|
-
_this4.targetHeight = _this4.$target.height();
|
|
4613
|
+
$(this).off(self.transitionendEvent);
|
|
4588
4614
|
}
|
|
4589
4615
|
});
|
|
4590
4616
|
this.onClose();
|
|
@@ -5422,7 +5448,7 @@
|
|
|
5422
5448
|
}
|
|
5423
5449
|
|
|
5424
5450
|
if (dialog.actions.remove.visible) {
|
|
5425
|
-
btnStyle =
|
|
5451
|
+
btnStyle = 'btn-remove';
|
|
5426
5452
|
btnClasses = dialog.actions.remove.classes ? ' ' + dialog.actions.remove.classes : '';
|
|
5427
5453
|
btnAttrs = dialog.actions.remove.attrs ? ' ' + dialog.actions.remove.attrs : '';
|
|
5428
5454
|
btnRemove = "\n <button type=\"button\" class=\"btn " + btnStyle + btnClasses + "\"" + btnAttrs + " data-dialog-remove>\n " + dialog.actions.remove.content + "\n </button>\n ";
|
|
@@ -5435,7 +5461,7 @@
|
|
|
5435
5461
|
btnConfirm = "\n <button type=\"button\" class=\"btn " + btnStyle + btnClasses + "\"" + btnAttrs + " data-dialog-confirm>\n " + dialog.actions.confirm.content + "\n </button>\n ";
|
|
5436
5462
|
}
|
|
5437
5463
|
|
|
5438
|
-
footer = "\n " +
|
|
5464
|
+
footer = "\n " + btnRemove + "\n <div class=\"spacer\"></div>\n " + btnCancel + "\n " + btnConfirm + "\n ";
|
|
5439
5465
|
} else {
|
|
5440
5466
|
return footer;
|
|
5441
5467
|
}
|