diff --git a/public/js/legacy/widgets/form/fields.js b/public/js/legacy/widgets/form/fields.js index 95570e6b19..47a4f5fa44 100644 --- a/public/js/legacy/widgets/form/fields.js +++ b/public/js/legacy/widgets/form/fields.js @@ -613,7 +613,7 @@ LinkField.prototype.make_input = function() { // setup buttons me.setup_buttons(); } - + me.onrefresh = function() { var can_create = in_list(wn.boot.profile.can_create, me.df.options); var can_read = in_list(wn.boot.profile.can_read, me.df.options); @@ -632,12 +632,13 @@ LinkField.prototype.make_input = function() { } me.get_value = function() { return me.txt.value; } - + // increasing zindex of input to increase zindex of autosuggest // because of the increase in zindex of dialog_wrapper - if(cur_dialog) { - console.log(cint($(cur_dialog.wrapper).css("z-index")) + 1) - $(me.txt).css({"z-index": cint($(cur_dialog.wrapper).css("z-index")) + 1}); + 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")); + $(me.txt).css({"z-index": (zindex >= 10 ? zindex : 10) + 1}); } $(me.txt).autocomplete({ @@ -1139,6 +1140,7 @@ SelectField.prototype.make_input = function() { else var v = null; } + this.input.set_input(v); } diff --git a/public/js/wn/ui/dialog.js b/public/js/wn/ui/dialog.js index 6328403b18..8da039331b 100644 --- a/public/js/wn/ui/dialog.js +++ b/public/js/wn/ui/dialog.js @@ -30,6 +30,8 @@ wn.ui.Dialog = wn.ui.FieldGroup.extend({ $.extend(this, opts); this.make(); + this.dialog_wrapper = this.wrapper; + // init fields if(this.fields) { this.parent = this.body diff --git a/public/js/wn/ui/field_group.js b/public/js/wn/ui/field_group.js index dd8dec581d..c3b74f1916 100644 --- a/public/js/wn/ui/field_group.js +++ b/public/js/wn/ui/field_group.js @@ -43,6 +43,7 @@ wn.ui.FieldGroup = Class.extend({ var div = $a(this.parent, 'div', '', {margin:'6px 0px'}) f = make_field(df, null, div, null); f.not_in_form = 1; + f.dialog_wrapper = this.dialog_wrapper || null; this.fields_dict[df.fieldname] = f f.refresh();