Fix single values

This commit is contained in:
Nathan Gray 2012-04-16 23:13:48 +00:00
parent 4407942ca6
commit df1f6b2ff4

View File

@ -841,7 +841,10 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], {
set_value: function(_value) { set_value: function(_value) {
// Get data // Get data
if(!_value || _value == null) return; if(!_value || _value == null) return;
if(!_value.to_app && this.options.application) _value.to_app = this.options.application; if(!_value.to_app && typeof _value == "object" && this.options.application)
{
_value.to_app = this.options.application;
}
if(typeof _value == 'object' && _value.to_app && _value.to_id) if(typeof _value == 'object' && _value.to_app && _value.to_id)
{ {
@ -849,7 +852,7 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], {
this._get_links(); this._get_links();
return; return;
} }
if(_value.length > 0) { if(typeof _value == 'object' && _value.length > 0) {
// Have full info // Have full info
// Don't store new value, just update display // Don't store new value, just update display
@ -864,6 +867,10 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], {
} }
} }
} }
else if(this.options.application)
{
this._add_link({id:_value, app: this.options.application});
}
}, },
_get_links: function() { _get_links: function() {