Skip to content

Instantly share code, notes, and snippets.

@splinter
Last active April 19, 2016 08:03
Show Gist options
  • Save splinter/e480a2208967b8adfa02cd99eee275f6 to your computer and use it in GitHub Desktop.
Save splinter/e480a2208967b8adfa02cd99eee275f6 to your computer and use it in GitHub Desktop.
var renderLCActions = function() {
var container = config(constants.CONTAINER_LC_ACTION_AREA);
var impl = LifecycleAPI.lifecycle();
var actions;
var action;
// var action;
if (impl) {
actions = impl.actions();
var data = {};
var map = data.actions = [];
var mapping;
for (var index = 0; index < actions.length; index++) {
action = actions[index];
mapping = {};
mapping.label = action;
mapping.style = 'btn-default';
map.push(mapping);
}
if(actions.length <= 0) {
var container = config(constants.INPUT_TEXTAREA_LC_COMMENT);
$(id(container)).hide();
}
renderPartial(constants.CONTAINER_LC_ACTION_AREA, constants.CONTAINER_LC_ACTION_AREA, data, wireLCActionHandlers);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment