Bläddra i källkod

[dialog link field] [fix] adjusted zindex of link field

version-14
Anand Doshi 12 år sedan
förälder
incheckning
ece3a36a1e
3 ändrade filer med 10 tillägg och 5 borttagningar
  1. +7
    -5
      public/js/legacy/widgets/form/fields.js
  2. +2
    -0
      public/js/wn/ui/dialog.js
  3. +1
    -0
      public/js/wn/ui/field_group.js

+ 7
- 5
public/js/legacy/widgets/form/fields.js Visa fil

@@ -613,7 +613,7 @@ LinkField.prototype.make_input = function() {
// setup buttons // setup buttons
me.setup_buttons(); me.setup_buttons();
} }
me.onrefresh = function() { me.onrefresh = function() {
var can_create = in_list(wn.boot.profile.can_create, me.df.options); 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); 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; } me.get_value = function() { return me.txt.value; }
// increasing zindex of input to increase zindex of autosuggest // increasing zindex of input to increase zindex of autosuggest
// because of the increase in zindex of dialog_wrapper // 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({ $(me.txt).autocomplete({
@@ -1139,6 +1140,7 @@ SelectField.prototype.make_input = function() {
else else
var v = null; var v = null;
} }
this.input.set_input(v); this.input.set_input(v);
} }


+ 2
- 0
public/js/wn/ui/dialog.js Visa fil

@@ -30,6 +30,8 @@ wn.ui.Dialog = wn.ui.FieldGroup.extend({
$.extend(this, opts); $.extend(this, opts);
this.make(); this.make();
this.dialog_wrapper = this.wrapper;
// init fields // init fields
if(this.fields) { if(this.fields) {
this.parent = this.body this.parent = this.body


+ 1
- 0
public/js/wn/ui/field_group.js Visa fil

@@ -43,6 +43,7 @@ wn.ui.FieldGroup = Class.extend({
var div = $a(this.parent, 'div', '', {margin:'6px 0px'}) var div = $a(this.parent, 'div', '', {margin:'6px 0px'})
f = make_field(df, null, div, null); f = make_field(df, null, div, null);
f.not_in_form = 1; f.not_in_form = 1;
f.dialog_wrapper = this.dialog_wrapper || null;
this.fields_dict[df.fieldname] = f this.fields_dict[df.fieldname] = f
f.refresh(); f.refresh();


Laddar…
Avbryt
Spara