Skip to content

Commit

Permalink
Merge pull request #17 from ezsystems/ezp-26011_no_search_resolve_embed
Browse files Browse the repository at this point in the history
EZP-26011: Directly load the main Location instead of searching for it
  • Loading branch information
andrerom authored Jul 25, 2016
2 parents 871902b + c8d5be6 commit 58a2f31
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,19 @@ YUI.add('cof-createcontent-universaldiscoveryserviceplugin', function (Y) {
var udwService = this.get('host'),
selection = {
contentType: udwService.get('contentType'),
};
},
mainLocation = new Y.eZ.Location();

if ( udwService.get('parameters').loadContent ) {
selection.content = event.content;
}

event.content.loadLocations({api: udwService.get('capi')}, function (error, locations) {
selection.location = locations[0];
selection.contentInfo = locations[0].get('contentInfo');
mainLocation.set('id', event.content.get('resources').MainLocation);
mainLocation.load({api: udwService.get('capi')}, function (error) {
selection.location = mainLocation;
selection.contentInfo = mainLocation.get('contentInfo');

udwService.get('app').set('loading', false);

udwService.get('eventTarget').fire('contentLoaded', selection);
});
},
Expand Down

0 comments on commit 58a2f31

Please sign in to comment.