Skip to content

Commit

Permalink
Apply default style when creating new channel
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jul 30, 2016
1 parent f669124 commit 6cc37b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions htdocs/frontend/javascripts/wui.js
Expand Up @@ -254,8 +254,14 @@ vz.wui.dialogs.init = function() {
$('#entity-create form table .optional').remove();

var container = $('#entity-create form table');
vz.wui.dialogs.addProperties(container, vz.capabilities.definitions.entities[$(this)[0].selectedIndex].required, "required");
vz.wui.dialogs.addProperties(container, vz.capabilities.definitions.entities[$(this)[0].selectedIndex].optional, "optional");
var entityDefinition = vz.capabilities.definitions.entities[$(this)[0].selectedIndex];
vz.wui.dialogs.addProperties(container, entityDefinition.required, "required");
vz.wui.dialogs.addProperties(container, entityDefinition.optional, "optional");

// set default style
if (entityDefinition.style) {
$(container).find('select[name=style] option[value=' + entityDefinition.style + ']').attr('selected', 'selected');
}
});
$('#entity-create select').change();

Expand Down

0 comments on commit 6cc37b6

Please sign in to comment.