fixes: U4-9419 The new content picker adds picked items in a random order
This commit is contained in:
@@ -259,18 +259,24 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
|
|||||||
});
|
});
|
||||||
|
|
||||||
function setEntityUrl(entity) {
|
function setEntityUrl(entity) {
|
||||||
|
|
||||||
// get url for content and media items
|
// get url for content and media items
|
||||||
if(entityType !== "Member") {
|
if(entityType !== "Member") {
|
||||||
entityResource.getUrl(entity.id, entityType).then(function(data){
|
entityResource.getUrl(entity.id, entityType).then(function(data){
|
||||||
// update url
|
// update url
|
||||||
entity.url = data;
|
angular.forEach($scope.renderModel, function(item){
|
||||||
|
if(item.id === entity.id) {
|
||||||
// push item to render model
|
item.url = data;
|
||||||
addSelectedItem(entity);
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
addSelectedItem(entity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add the selected item to the renderModel
|
||||||
|
// if it needs to show a url the item will get
|
||||||
|
// updated when the url comes back from server
|
||||||
|
addSelectedItem(entity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addSelectedItem(item) {
|
function addSelectedItem(item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user