Fix bug losing app when passing {app:... id:...} to link entry

This commit is contained in:
Nathan Gray 2013-05-29 15:26:22 +00:00
parent 5fba6a1503
commit e948a270f6

View File

@ -421,7 +421,10 @@ var et2_link_entry = et2_inputWidget.extend(
this.search = null; this.search = null;
this.app_select = null; this.app_select = null;
this._oldValue = {id: null, app: this.options.only_app}; this._oldValue = {
id: null,
app: this.options.value && this.options.value.app ? this.options.value.app : this.options.only_app
};
if(typeof this.options.value == 'undefined' || this.options.value == null) if(typeof this.options.value == 'undefined' || this.options.value == null)
{ {
@ -461,9 +464,17 @@ var et2_link_entry = et2_inputWidget.extend(
.text(this.options.select_options[key]); .text(this.options.select_options[key]);
option.appendTo(this.app_select); option.appendTo(this.app_select);
} }
this.app_select.val(this.options.only_app ? this.options.only_app : this.options.application_list[0]); if(self.options.value && self.options.value.app)
{
this.app_select.val(self.options.value.app);
}
else
{
this.app_select.val(this.options.application_list[0]);
}
if(this.options.only_app) if(this.options.only_app)
{ {
this.app_select.val(this.options.only_app);
this.app_select.hide(); this.app_select.hide();
this.div.addClass("no_app"); this.div.addClass("no_app");
} }