multilevel menu bug fix update 2

pull/776/head
razvanaldea89 2019-02-22 12:40:24 +02:00
parent 416a917105
commit 86a809dca4
39 changed files with 405 additions and 397 deletions

View File

@ -49,7 +49,6 @@
return function debounced () { return function debounced () {
var obj = this, args = arguments; var obj = this, args = arguments;
function delayed () { function delayed () {
if (!execAsap) if (!execAsap)
func.apply(obj, args); func.apply(obj, args);
@ -66,9 +65,7 @@
}; };
// smartresize // smartresize
jQuery.fn[sr] = function (fn) { jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr);
};
})(jQuery,'smartresize'); })(jQuery,'smartresize');
/** /**
@ -77,8 +74,21 @@
* and open the template in the editor. * and open the template in the editor.
*/ */
var CURRENT_URL = window.location.href.split("#")[0].split("?")[0],
$BODY = $("body"),
$MENU_TOGGLE = $("#menu_toggle"),
$SIDEBAR_MENU = $("#sidebar-menu"),
$SIDEBAR_FOOTER = $(".sidebar-footer"),
$LEFT_COL = $(".left_col"),
$RIGHT_COL = $(".right_col"),
$NAV_MENU = $(".nav_menu"),
$FOOTER = $("footer"),
randNum = function() {
return Math.floor(21 * Math.random()) + 20
};
var setContentHeight = function () { var setContentHeight = function () {
// reset height
$RIGHT_COL.css('min-height', $(window).height()); $RIGHT_COL.css('min-height', $(window).height());
var bodyHeight = $BODY.outerHeight(), var bodyHeight = $BODY.outerHeight(),
@ -94,6 +104,7 @@ var setContentHeight = function () {
/* SIDEBAR */ /* SIDEBAR */
$(document).ready(function() { $(document).ready(function() {
$SIDEBAR_MENU.find('a').on('click', function(ev) { $SIDEBAR_MENU.find('a').on('click', function(ev) {
var $li = $(this).parent(); var $li = $(this).parent();
var child_menu = $('ul:first', $li); var child_menu = $('ul:first', $li);
@ -103,14 +114,21 @@ $(document).ready(function () {
$li.removeClass('active active-sm'); $li.removeClass('active active-sm');
$('ul:first', $li).slideUp(function() { $('ul:first', $li).slideUp(function() {
setContentHeight(); setContentHeight();
if ($('.left_col.menu_fixed > .mCustomScrollBox > .mCSB_container ').length) {
$('.left_col.menu_fixed > .mCustomScrollBox > .mCSB_container ').css('min-height', '0');
}
}); });
} else { }
else
{
// prevent closing menu if we are on child menu // prevent closing menu if we are on child menu
if (!$li.parent().is('.child_menu')) { if (!$li.parent().is('.child_menu')) {
$SIDEBAR_MENU.find('li').removeClass('active active-sm'); $SIDEBAR_MENU.find('li').removeClass('active active-sm');
$SIDEBAR_MENU.find('li ul').slideUp(); $SIDEBAR_MENU.find('li ul').slideUp();
} else { }else
if ($BODY.is(".nav-sm")) { {
if ( $BODY.is( ".nav-sm" ) )
{
if (!$li.parent().is('.child_menu')) { if (!$li.parent().is('.child_menu')) {
$SIDEBAR_MENU.find('li').removeClass('active active-sm'); $SIDEBAR_MENU.find('li').removeClass('active active-sm');
$SIDEBAR_MENU.find('li ul').slideUp(); $SIDEBAR_MENU.find('li ul').slideUp();
@ -118,6 +136,7 @@ $(document).ready(function () {
} }
} }
$li.addClass('active'); $li.addClass('active');
child_menu.slideDown(function () { child_menu.slideDown(function () {
setContentHeight(); setContentHeight();
// fix for fixed sidebar menu // fix for fixed sidebar menu
@ -170,9 +189,7 @@ $(document).ready(function () {
setContentHeight(); setContentHeight();
$('.dataTable').each(function () { $('.dataTable').each ( function () { $(this).dataTable().fnDraw(); });
$(this).dataTable().fnDraw();
});
}); });
// check active menu // check active menu
@ -217,10 +234,6 @@ $(document).ready(function () {
} }
}); });
// fix for content height using js and not overwriting with CSS. Function should be called after the DataTable function has run it's corse.
$(window).load(function () {
setContentHeight();
});
/* SIDEBAR - end */ /* SIDEBAR - end */
@ -911,8 +924,7 @@ function init_parsley() {
}; };
try { try {
hljs.initHighlightingOnLoad() hljs.initHighlightingOnLoad()
} catch (a) { } catch (a) {}
}
} }
} }
@ -950,7 +962,6 @@ function init_wysiwyg() {
var c = ""; var c = "";
"unsupported-file-type" === a ? c = "Unsupported format " + b : console.log("error uploading file", a, b), $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button><strong>File upload error</strong> ' + c + " </div>").prependTo("#alerts") "unsupported-file-type" === a ? c = "Unsupported format " + b : console.log("error uploading file", a, b), $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button><strong>File upload error</strong> ' + c + " </div>").prependTo("#alerts")
} }
"undefined" != typeof $.fn.wysiwyg && (console.log("init_wysiwyg"), $(".editor-wrapper").each(function() { "undefined" != typeof $.fn.wysiwyg && (console.log("init_wysiwyg"), $(".editor-wrapper").each(function() {
var a = $(this).attr("id"); var a = $(this).attr("id");
$(this).wysiwyg({ $(this).wysiwyg({
@ -1060,8 +1071,7 @@ function init_cropper() {
function init_knob() { function init_knob() {
if ("undefined" != typeof $.fn.knob) { if ("undefined" != typeof $.fn.knob) {
console.log("init_knob"), $(".knob").knob({ console.log("init_knob"), $(".knob").knob({
change: function (a) { change: function(a) {},
},
release: function(a) { release: function(a) {
console.log("release : " + a) console.log("release : " + a)
}, },
@ -1410,8 +1420,7 @@ function init_EasyPieChart() {
}); });
var b = $.fn.popover.Constructor.prototype.leave; var b = $.fn.popover.Constructor.prototype.leave;
$.fn.popover.Constructor.prototype.leave = function(a) { $.fn.popover.Constructor.prototype.leave = function(a) {
var d, e, var d, e, c = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
c = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
b.call(this, a), a.currentTarget && (d = $(a.currentTarget).siblings(".popover"), e = c.timeout, d.one("mouseenter", function() { b.call(this, a), a.currentTarget && (d = $(a.currentTarget).siblings(".popover"), e = c.timeout, d.one("mouseenter", function() {
clearTimeout(e), d.one("mouseleave", function() { clearTimeout(e), d.one("mouseleave", function() {
$.fn.popover.Constructor.prototype.leave.call(c, c) $.fn.popover.Constructor.prototype.leave.call(c, c)
@ -4253,16 +4262,13 @@ function init_echarts() {
}) })
} }
} }
} }! function(a, b) {
!function (a, b) {
var c = function(a, b, c) { var c = function(a, b, c) {
var d; var d;
return function() { return function() {
function h() { function h() {
c || a.apply(f, g), d = null c || a.apply(f, g), d = null
} }
var f = this, var f = this,
g = arguments; g = arguments;
d ? clearTimeout(d) : c && a.apply(f, g), d = setTimeout(h, b || 100) d ? clearTimeout(d) : c && a.apply(f, g), d = setTimeout(h, b || 100)
@ -4273,19 +4279,6 @@ function init_echarts() {
} }
}(jQuery, "smartresize"); }(jQuery, "smartresize");
var CURRENT_URL = window.location.href.split("#")[0].split("?")[0],
$BODY = $("body"),
$MENU_TOGGLE = $("#menu_toggle"),
$SIDEBAR_MENU = $("#sidebar-menu"),
$SIDEBAR_FOOTER = $(".sidebar-footer"),
$LEFT_COL = $(".left_col"),
$RIGHT_COL = $(".right_col"),
$NAV_MENU = $(".nav_menu"),
$FOOTER = $("footer"),
randNum = function () {
return Math.floor(21 * Math.random()) + 20
};
$(document).ready(function() { $(document).ready(function() {
$(".collapse-link").on("click", function() { $(".collapse-link").on("click", function() {
var a = $(this).closest(".x_panel"), var a = $(this).closest(".x_panel"),
@ -4343,8 +4336,7 @@ $(".bulk_action input").on("ifChecked", function () {
})); }));
var originalLeave = $.fn.popover.Constructor.prototype.leave; var originalLeave = $.fn.popover.Constructor.prototype.leave;
$.fn.popover.Constructor.prototype.leave = function(a) { $.fn.popover.Constructor.prototype.leave = function(a) {
var c, d, var c, d, b = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
b = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
originalLeave.call(this, a), a.currentTarget && (c = $(a.currentTarget).siblings(".popover"), d = b.timeout, c.one("mouseenter", function() { originalLeave.call(this, a), a.currentTarget && (c = $(a.currentTarget).siblings(".popover"), d = b.timeout, c.one("mouseenter", function() {
clearTimeout(d), c.one("mouseleave", function() { clearTimeout(d), c.one("mouseleave", function() {
$.fn.popover.Constructor.prototype.leave.call(b, b) $.fn.popover.Constructor.prototype.leave.call(b, b)

File diff suppressed because one or more lines are too long

View File

@ -447,7 +447,7 @@
<script src="../vendors/fullcalendar/dist/fullcalendar.min.js"></script> <script src="../vendors/fullcalendar/dist/fullcalendar.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -527,7 +527,7 @@
<script src="../vendors/Chart.js/dist/Chart.min.js"></script> <script src="../vendors/Chart.js/dist/Chart.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -530,7 +530,7 @@
<script src="../vendors/Chart.js/dist/Chart.min.js"></script> <script src="../vendors/Chart.js/dist/Chart.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -817,6 +817,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -535,6 +535,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -712,7 +712,7 @@
<script src="../vendors/echarts/map/js/world.js"></script> <script src="../vendors/echarts/map/js/world.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -321,6 +321,6 @@
<script src="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script> <script src="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -144,9 +144,65 @@
</li> </li>
<li><a href="#level2_2">Level Two</a> <li><a href="#level2_2">Level Two</a>
</li> </li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
</ul> </ul>
</li> </li>
<li><a href="#level1_2">Level One</a> <li><a href="#level1_2">Level One</a>
<ul class="nav child_menu">
<li class="sub_menu"><a href="level2.html">Level Two</a>
</li>
<li><a href="#level2_1">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
<li><a href="#level2_2">Level Two</a>
</li>
</ul>
</li> </li>
</ul> </ul>
</li> </li>
@ -320,6 +376,6 @@
<script src="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script> <script src="../vendors/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -1678,7 +1678,7 @@
<!-- starrr --> <!-- starrr -->
<script src="../vendors/starrr/dist/starrr.js"></script> <script src="../vendors/starrr/dist/starrr.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -2659,7 +2659,7 @@
<script src="../vendors/cropper/dist/cropper.min.js"></script> <script src="../vendors/cropper/dist/cropper.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
<!-- Initialize datetimepicker --> <!-- Initialize datetimepicker -->
<script> <script>

View File

@ -775,6 +775,6 @@
<script src="../vendors/fastclick/lib/fastclick.js"></script> <script src="../vendors/fastclick/lib/fastclick.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -371,6 +371,6 @@
<script src="../vendors/dropzone/dist/min/dropzone.min.js"></script> <script src="../vendors/dropzone/dist/min/dropzone.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -523,7 +523,7 @@
<script src="../vendors/validator/validator.js"></script> <script src="../vendors/validator/validator.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -768,7 +768,7 @@
<!-- jQuery Smart Wizard --> <!-- jQuery Smart Wizard -->
<script src="../vendors/jQuery-Smart-Wizard/js/jquery.smartWizard.js"></script> <script src="../vendors/jQuery-Smart-Wizard/js/jquery.smartWizard.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>

View File

@ -2185,7 +2185,7 @@
<script src="../vendors/pnotify/dist/pnotify.nonblock.js"></script> <script src="../vendors/pnotify/dist/pnotify.nonblock.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -2126,6 +2126,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -3400,6 +3400,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -772,7 +772,7 @@
<script src="../vendors/google-code-prettify/src/prettify.js"></script> <script src="../vendors/google-code-prettify/src/prettify.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -154,38 +154,6 @@
</li> </li>
<li><a href="#level2_2">Level Two</a> <li><a href="#level2_2">Level Two</a>
</li> </li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
<li><a href="#level2_2">Test</a>
</li>
</ul> </ul>
</li> </li>
<li><a href="#level1_2">Level One</a> <li><a href="#level1_2">Level One</a>
@ -1177,7 +1145,7 @@
<script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script> <script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -839,6 +839,6 @@
<script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script> <script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -952,7 +952,7 @@
<script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script> <script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -539,6 +539,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -316,6 +316,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -578,6 +578,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -528,7 +528,7 @@
<script src="../vendors/morris.js/morris.min.js"></script> <script src="../vendors/morris.js/morris.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -482,7 +482,7 @@
<script src="../vendors/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js"></script> <script src="../vendors/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -66,6 +66,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -360,6 +360,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -562,6 +562,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -678,7 +678,7 @@
<script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script> <script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -528,7 +528,7 @@
<script src="../vendors/echarts/dist/echarts.min.js"></script> <script src="../vendors/echarts/dist/echarts.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -869,6 +869,6 @@
<script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script> <script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -778,6 +778,6 @@
<script src="../vendors/iCheck/icheck.min.js"></script> <script src="../vendors/iCheck/icheck.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -3754,7 +3754,7 @@
<script src="../vendors/pdfmake/build/vfs_fonts.js"></script> <script src="../vendors/pdfmake/build/vfs_fonts.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -415,6 +415,6 @@
<script src="../vendors/nprogress/nprogress.js"></script> <script src="../vendors/nprogress/nprogress.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -1053,7 +1053,7 @@
<script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script> <script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<!-- Custom Theme Scripts --> <!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script> <script src="../build/js/custom.js"></script>
</body> </body>
</html> </html>

View File

@ -14,7 +14,6 @@
return function debounced () { return function debounced () {
var obj = this, args = arguments; var obj = this, args = arguments;
function delayed () { function delayed () {
if (!execAsap) if (!execAsap)
func.apply(obj, args); func.apply(obj, args);
@ -31,9 +30,7 @@
}; };
// smartresize // smartresize
jQuery.fn[sr] = function (fn) { jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr);
};
})(jQuery,'smartresize'); })(jQuery,'smartresize');
/** /**
@ -42,8 +39,21 @@
* and open the template in the editor. * and open the template in the editor.
*/ */
var CURRENT_URL = window.location.href.split("#")[0].split("?")[0],
$BODY = $("body"),
$MENU_TOGGLE = $("#menu_toggle"),
$SIDEBAR_MENU = $("#sidebar-menu"),
$SIDEBAR_FOOTER = $(".sidebar-footer"),
$LEFT_COL = $(".left_col"),
$RIGHT_COL = $(".right_col"),
$NAV_MENU = $(".nav_menu"),
$FOOTER = $("footer"),
randNum = function() {
return Math.floor(21 * Math.random()) + 20
};
var setContentHeight = function () { var setContentHeight = function () {
// reset height
$RIGHT_COL.css('min-height', $(window).height()); $RIGHT_COL.css('min-height', $(window).height());
var bodyHeight = $BODY.outerHeight(), var bodyHeight = $BODY.outerHeight(),
@ -59,6 +69,7 @@ var setContentHeight = function () {
/* SIDEBAR */ /* SIDEBAR */
$(document).ready(function() { $(document).ready(function() {
$SIDEBAR_MENU.find('a').on('click', function(ev) { $SIDEBAR_MENU.find('a').on('click', function(ev) {
var $li = $(this).parent(); var $li = $(this).parent();
var child_menu = $('ul:first', $li); var child_menu = $('ul:first', $li);
@ -68,14 +79,21 @@ $(document).ready(function () {
$li.removeClass('active active-sm'); $li.removeClass('active active-sm');
$('ul:first', $li).slideUp(function() { $('ul:first', $li).slideUp(function() {
setContentHeight(); setContentHeight();
if ($('.left_col.menu_fixed > .mCustomScrollBox > .mCSB_container ').length) {
$('.left_col.menu_fixed > .mCustomScrollBox > .mCSB_container ').css('min-height', '0');
}
}); });
} else { }
else
{
// prevent closing menu if we are on child menu // prevent closing menu if we are on child menu
if (!$li.parent().is('.child_menu')) { if (!$li.parent().is('.child_menu')) {
$SIDEBAR_MENU.find('li').removeClass('active active-sm'); $SIDEBAR_MENU.find('li').removeClass('active active-sm');
$SIDEBAR_MENU.find('li ul').slideUp(); $SIDEBAR_MENU.find('li ul').slideUp();
} else { }else
if ($BODY.is(".nav-sm")) { {
if ( $BODY.is( ".nav-sm" ) )
{
if (!$li.parent().is('.child_menu')) { if (!$li.parent().is('.child_menu')) {
$SIDEBAR_MENU.find('li').removeClass('active active-sm'); $SIDEBAR_MENU.find('li').removeClass('active active-sm');
$SIDEBAR_MENU.find('li ul').slideUp(); $SIDEBAR_MENU.find('li ul').slideUp();
@ -83,6 +101,7 @@ $(document).ready(function () {
} }
} }
$li.addClass('active'); $li.addClass('active');
child_menu.slideDown(function () { child_menu.slideDown(function () {
setContentHeight(); setContentHeight();
// fix for fixed sidebar menu // fix for fixed sidebar menu
@ -135,9 +154,7 @@ $(document).ready(function () {
setContentHeight(); setContentHeight();
$('.dataTable').each(function () { $('.dataTable').each ( function () { $(this).dataTable().fnDraw(); });
$(this).dataTable().fnDraw();
});
}); });
// check active menu // check active menu
@ -182,10 +199,6 @@ $(document).ready(function () {
} }
}); });
// fix for content height using js and not overwriting with CSS. Function should be called after the DataTable function has run it's corse.
$(window).load(function () {
setContentHeight();
});
/* SIDEBAR - end */ /* SIDEBAR - end */
@ -876,8 +889,7 @@ function init_parsley() {
}; };
try { try {
hljs.initHighlightingOnLoad() hljs.initHighlightingOnLoad()
} catch (a) { } catch (a) {}
}
} }
} }
@ -915,7 +927,6 @@ function init_wysiwyg() {
var c = ""; var c = "";
"unsupported-file-type" === a ? c = "Unsupported format " + b : console.log("error uploading file", a, b), $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button><strong>File upload error</strong> ' + c + " </div>").prependTo("#alerts") "unsupported-file-type" === a ? c = "Unsupported format " + b : console.log("error uploading file", a, b), $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button><strong>File upload error</strong> ' + c + " </div>").prependTo("#alerts")
} }
"undefined" != typeof $.fn.wysiwyg && (console.log("init_wysiwyg"), $(".editor-wrapper").each(function() { "undefined" != typeof $.fn.wysiwyg && (console.log("init_wysiwyg"), $(".editor-wrapper").each(function() {
var a = $(this).attr("id"); var a = $(this).attr("id");
$(this).wysiwyg({ $(this).wysiwyg({
@ -1025,8 +1036,7 @@ function init_cropper() {
function init_knob() { function init_knob() {
if ("undefined" != typeof $.fn.knob) { if ("undefined" != typeof $.fn.knob) {
console.log("init_knob"), $(".knob").knob({ console.log("init_knob"), $(".knob").knob({
change: function (a) { change: function(a) {},
},
release: function(a) { release: function(a) {
console.log("release : " + a) console.log("release : " + a)
}, },
@ -1375,8 +1385,7 @@ function init_EasyPieChart() {
}); });
var b = $.fn.popover.Constructor.prototype.leave; var b = $.fn.popover.Constructor.prototype.leave;
$.fn.popover.Constructor.prototype.leave = function(a) { $.fn.popover.Constructor.prototype.leave = function(a) {
var d, e, var d, e, c = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
c = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
b.call(this, a), a.currentTarget && (d = $(a.currentTarget).siblings(".popover"), e = c.timeout, d.one("mouseenter", function() { b.call(this, a), a.currentTarget && (d = $(a.currentTarget).siblings(".popover"), e = c.timeout, d.one("mouseenter", function() {
clearTimeout(e), d.one("mouseleave", function() { clearTimeout(e), d.one("mouseleave", function() {
$.fn.popover.Constructor.prototype.leave.call(c, c) $.fn.popover.Constructor.prototype.leave.call(c, c)
@ -4218,16 +4227,13 @@ function init_echarts() {
}) })
} }
} }
} }! function(a, b) {
!function (a, b) {
var c = function(a, b, c) { var c = function(a, b, c) {
var d; var d;
return function() { return function() {
function h() { function h() {
c || a.apply(f, g), d = null c || a.apply(f, g), d = null
} }
var f = this, var f = this,
g = arguments; g = arguments;
d ? clearTimeout(d) : c && a.apply(f, g), d = setTimeout(h, b || 100) d ? clearTimeout(d) : c && a.apply(f, g), d = setTimeout(h, b || 100)
@ -4238,19 +4244,6 @@ function init_echarts() {
} }
}(jQuery, "smartresize"); }(jQuery, "smartresize");
var CURRENT_URL = window.location.href.split("#")[0].split("?")[0],
$BODY = $("body"),
$MENU_TOGGLE = $("#menu_toggle"),
$SIDEBAR_MENU = $("#sidebar-menu"),
$SIDEBAR_FOOTER = $(".sidebar-footer"),
$LEFT_COL = $(".left_col"),
$RIGHT_COL = $(".right_col"),
$NAV_MENU = $(".nav_menu"),
$FOOTER = $("footer"),
randNum = function () {
return Math.floor(21 * Math.random()) + 20
};
$(document).ready(function() { $(document).ready(function() {
$(".collapse-link").on("click", function() { $(".collapse-link").on("click", function() {
var a = $(this).closest(".x_panel"), var a = $(this).closest(".x_panel"),
@ -4308,8 +4301,7 @@ $(".bulk_action input").on("ifChecked", function () {
})); }));
var originalLeave = $.fn.popover.Constructor.prototype.leave; var originalLeave = $.fn.popover.Constructor.prototype.leave;
$.fn.popover.Constructor.prototype.leave = function(a) { $.fn.popover.Constructor.prototype.leave = function(a) {
var c, d, var c, d, b = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
b = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
originalLeave.call(this, a), a.currentTarget && (c = $(a.currentTarget).siblings(".popover"), d = b.timeout, c.one("mouseenter", function() { originalLeave.call(this, a), a.currentTarget && (c = $(a.currentTarget).siblings(".popover"), d = b.timeout, c.one("mouseenter", function() {
clearTimeout(d), c.one("mouseleave", function() { clearTimeout(d), c.one("mouseleave", function() {
$.fn.popover.Constructor.prototype.leave.call(b, b) $.fn.popover.Constructor.prototype.leave.call(b, b)