Merge pull request #2062 from OpenRefine/issue-2046-entity-cache
Fix datavalue rendering cache in Wikidata preview
This commit is contained in:
commit
c062641698
@ -224,8 +224,9 @@ EditRenderer._renderValue = function(json, container) {
|
|||||||
EditRenderer._renderEntity(json.datavalue, container);
|
EditRenderer._renderEntity(json.datavalue, container);
|
||||||
} else {
|
} else {
|
||||||
var jsonValue = JSON.stringify(json.datavalue);
|
var jsonValue = JSON.stringify(json.datavalue);
|
||||||
if (jsonValue in EditRenderer.renderedValueCache) {
|
var fullJsonValue = JSON.stringify(json);
|
||||||
$('<span>'+EditRenderer.renderedValueCache[jsonValue]+'</span>').appendTo(container);
|
if (fullJsonValue in EditRenderer.renderedValueCache) {
|
||||||
|
$('<span>'+EditRenderer.renderedValueCache[fullJsonValue]+'</span>').appendTo(container);
|
||||||
} else {
|
} else {
|
||||||
var params = {
|
var params = {
|
||||||
action: 'wbformatvalue',
|
action: 'wbformatvalue',
|
||||||
@ -244,7 +245,7 @@ EditRenderer._renderValue = function(json, container) {
|
|||||||
params,
|
params,
|
||||||
function (data) {
|
function (data) {
|
||||||
if('result' in data) {
|
if('result' in data) {
|
||||||
EditRenderer.renderedValueCache[jsonValue] = data.result;
|
EditRenderer.renderedValueCache[fullJsonValue] = data.result;
|
||||||
$('<span>'+data.result+'</span>').appendTo(container);
|
$('<span>'+data.result+'</span>').appendTo(container);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user