Skip to content

Commit

Permalink
Updated components.js
Browse files Browse the repository at this point in the history
  • Loading branch information
flommy committed Apr 13, 2021
1 parent 9c27a23 commit c1b2410
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions modules/Cockpit/assets/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -3162,9 +3162,15 @@ riot.tag2('field-layout', '<div class="uk-sortable layout-components {!items.len
}.bind(this)

this.getPreview = function(component) {
var triggerOutput = [];
App.trigger('field.layout.component.preview', {component: component, def: this.components[component.component], output: triggerOutput});
if (triggerOutput.length > 0) return triggerOutput.join('');
var params = {
component: component,
definition: this.components[component.component],
output: false
};

App.trigger('field.layout.component.preview', params);

if (params.output) return params.output;

var def = this.components[component.component];

Expand Down

0 comments on commit c1b2410

Please sign in to comment.