Fix files selected from filemanager before entry is saved do not show in link list until entry is saved.

This commit is contained in:
Nathan Gray 2014-12-10 17:58:42 +00:00
parent 85d531e797
commit 3474836244

View File

@ -1573,11 +1573,11 @@ var et2_link_list = et2_link_string.extend(
set_value: function(_value) set_value: function(_value)
{ {
this.list.empty();
// Handle server passed a list of links that aren't ready yet // Handle server passed a list of links that aren't ready yet
if(_value && typeof _value == "object") if(_value && typeof _value == "object")
{ {
var list = []; var list = [];
this.list.empty();
if(_value.to_id && typeof _value.to_id == "object") if(_value.to_id && typeof _value.to_id == "object")
{ {
list = _value.to_id; list = _value.to_id;
@ -1628,7 +1628,7 @@ var et2_link_list = et2_link_string.extend(
_add_link: function(_link_data) { _add_link: function(_link_data) {
var row = $j(document.createElement("tr")) var row = $j(document.createElement("tr"))
.attr("id", "link_"+(_link_data.dom_id ? _link_data.dom_id : (typeof _link_data.link_id == "number" ? _link_data.link_id : _link_data.link_id.replace(/[:\.]/g,'_')))) .attr("id", "link_"+(_link_data.dom_id ? _link_data.dom_id : (typeof _link_data.link_id == "string" ? _link_data.link_id.replace(/[:\.]/g,'_'):_link_data.link_id ||_link_data.id)))
.attr("draggable", _link_data.app == 'file' ? "true" : "") .attr("draggable", _link_data.app == 'file' ? "true" : "")
.appendTo(this.list); .appendTo(this.list);
if(!_link_data.link_id) if(!_link_data.link_id)