Only show divider between core & custom commands if there are core commands

This commit is contained in:
Gina Häußge 2015-10-01 14:19:00 +02:00
parent 97e8326768
commit 950b1c2355

View file

@ -26,12 +26,14 @@ $(function() {
self.fromCommandResponse = function(response) {
var actions = [];
_.each(response.core, function(data) {
var action = _.extend({}, data);
action.actionSource = "core";
actions.push(action);
});
actions.push({action: "divider"});
if (response.core && response.core.length) {
_.each(response.core, function(data) {
var action = _.extend({}, data);
action.actionSource = "core";
actions.push(action);
});
actions.push({action: "divider"});
}
_.each(response.custom, function(data) {
var action = _.extend({}, data);
action.actionSource = "custom";