1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-22 01:44:25 +04:00

bootstrap dropdowns fix, build fix

This commit is contained in:
codecalm
2020-02-19 21:57:01 +01:00
parent e6f6368d56
commit d0cded0e98
3 changed files with 50 additions and 48 deletions

View File

@@ -1,7 +1,5 @@
'use strict'; 'use strict';
import {Dropdown, Tooltip, Popover} from 'bootstrap';
import 'popper.js';
import {CountUp} from "countup.js"; import {CountUp} from "countup.js";
(function () { (function () {
@@ -10,7 +8,7 @@ import {CountUp} from "countup.js";
*/ */
var dropdownElementList = [].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')); var dropdownElementList = [].slice.call(document.querySelectorAll('[data-toggle="dropdown"]'));
dropdownElementList.map(function (dropdownToggleEl) { dropdownElementList.map(function (dropdownToggleEl) {
return new Dropdown(dropdownToggleEl, {}) return new bootstrap.Dropdown(dropdownToggleEl, {})
}); });
/** /**
@@ -18,7 +16,7 @@ import {CountUp} from "countup.js";
*/ */
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="tooltip"]')); var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) { tooltipTriggerList.map(function (tooltipTriggerEl) {
return new Tooltip(tooltipTriggerEl, {}) return new bootstrap.Tooltip(tooltipTriggerEl, {})
}); });
/* /*
@@ -26,7 +24,7 @@ import {CountUp} from "countup.js";
*/ */
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="popover"]')); var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="popover"]'));
popoverTriggerList.map(function (popoverTriggerEl) { popoverTriggerList.map(function (popoverTriggerEl) {
return new Popover(popoverTriggerEl, { return new bootstrap.Popover(popoverTriggerEl, {
autoHide: true autoHide: true
}) })
}); });
@@ -37,7 +35,10 @@ import {CountUp} from "countup.js";
let countupTriggerList = [].slice.call(document.querySelectorAll("[data-countup]")); let countupTriggerList = [].slice.call(document.querySelectorAll("[data-countup]"));
countupTriggerList.map(function (countupTriggerEl) { countupTriggerList.map(function (countupTriggerEl) {
let dataCountUp; let dataCountUp;
if(countupTriggerEl.getAttribute("data-countup") != "") dataCountUp = JSON.parse(countupTriggerEl.getAttribute("data-countup")); if(countupTriggerEl.getAttribute("data-countup") !== "") {
dataCountUp = JSON.parse(countupTriggerEl.getAttribute("data-countup"));
}
return (new CountUp(countupTriggerEl, parseFloat(countupTriggerEl.innerText), dataCountUp)).start(); return (new CountUp(countupTriggerEl, parseFloat(countupTriggerEl.innerText), dataCountUp)).start();
}); });
})(); })();

View File

@@ -113,7 +113,7 @@
"@fullcalendar/timegrid": "4.4.0", "@fullcalendar/timegrid": "4.4.0",
"apexcharts": "3.15.6", "apexcharts": "3.15.6",
"autosize": "4.0.2", "autosize": "4.0.2",
"bootstrap": "twbs/bootstrap#9c57f79", "bootstrap": "twbs/bootstrap#557e9cf",
"countup.js": "2.0.4", "countup.js": "2.0.4",
"daterangepicker": "3.0.5", "daterangepicker": "3.0.5",
"flatpickr": "4.6.3", "flatpickr": "4.6.3",

View File

@@ -1,8 +1,9 @@
{ {
"global-libs": [ "global-libs": [
"jquery" "bootstrap", "jquery"
], ],
"js": { "js": {
"bootstrap": "bootstrap/dist/js/bootstrap.bundle.js",
"jquery": "jquery/dist/jquery.slim.min.js", "jquery": "jquery/dist/jquery.slim.min.js",
"autosize": "autosize/dist/autosize.min.js", "autosize": "autosize/dist/autosize.min.js",
"imask": "imask/dist/imask.min.js", "imask": "imask/dist/imask.min.js",