From eb302a6dab40d074067238ef6d0b3390e6383176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3i=20Juhasz?= Date: Wed, 19 Oct 2016 19:40:25 +0000 Subject: [PATCH] zIndex not correct When displaying the widget, the domtree is scanned, but only gets the z-index of the "top-most" parent which doesn't have "z-index: auto;". This change will let it get the highest z-index value, instead of the "top-most not auto" z-index. --- js/bootstrap-timepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-timepicker.js b/js/bootstrap-timepicker.js index bbb923c5..92736b04 100644 --- a/js/bootstrap-timepicker.js +++ b/js/bootstrap-timepicker.js @@ -663,7 +663,7 @@ var widgetWidth = this.$widget.outerWidth(), widgetHeight = this.$widget.outerHeight(), visualPadding = 10, windowWidth = $(window).width(), windowHeight = $(window).height(), scrollTop = $(window).scrollTop(); - var zIndex = parseInt(this.$element.parents().filter(function() { return $(this).css('z-index') !== 'auto'; }).first().css('z-index'), 10) + 10; + var zIndex = Math.max.apply(Math, this.$element.parents().filter(function() { return $(this).css('z-index') !== 'auto'; }).map(function() { return parseInt($(this).css('z-index'), 10); })); var offset = this.component ? this.component.parent().offset() : this.$element.offset(); var height = this.component ? this.component.outerHeight(true) : this.$element.outerHeight(false); var width = this.component ? this.component.outerWidth(true) : this.$element.outerWidth(false);