From 0ebe63671c33a2fe56e87ecdc253fdce22de40c3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 27 May 2013 18:03:13 +0530 Subject: [PATCH] [autocomplete] fixed z-index in dialog to close #129 --- public/js/wn/form/control.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/public/js/wn/form/control.js b/public/js/wn/form/control.js index d641b52864..66ca32e721 100644 --- a/public/js/wn/form/control.js +++ b/public/js/wn/form/control.js @@ -598,14 +598,6 @@ wn.ui.form.ControlLink = wn.ui.form.ControlData.extend({ }, setup_autocomplete: function() { var me = this; - // increasing zindex of input to increase zindex of autosuggest - // because of the increase in zindex of dialog_wrapper - if(cur_dialog || me.dialog_wrapper) { - var $dialog_wrapper = $(cur_dialog ? cur_dialog.wrapper : me.dialog_wrapper) - var zindex = cint($dialog_wrapper.css("z-index")); - this.$input.css({"z-index": (zindex >= 10 ? zindex : 10) + 1}); - } - this.$input.autocomplete({ source: function(request, response) { var args = { @@ -625,6 +617,10 @@ wn.ui.form.ControlLink = wn.ui.form.ControlData.extend({ }); }, open: function(event, ui) { + if(cur_dialog) { + var zindex = cint(cur_dialog.$wrapper.css("z-index")) + 1 + $(this).autocomplete("widget").css("z-index", zindex); + } me.autocomplete_open = true; }, close: function(event, ui) {