Skip to content

Commit

Permalink
spread the magic
Browse files Browse the repository at this point in the history
  • Loading branch information
w33ble committed Jan 21, 2016
1 parent c312603 commit 61dbbeb
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/ui/public/navbar/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ navbar.directive('navbar', function (Private, $compile) {
if ($buttonGroup.length !== 1) throw new Error('navbar must have exactly 1 button group');

const extensions = getExtensions($attrs.name);
const controls = $buttonGroup.children().detach().toArray().map(function (button) {
return {
order: 0,
$el: $(button),
};
}).concat(extensions.map(function (extension, i) {
return {
order: extension.order,
index: i,
extension: extension,
};
}));
const buttons = $buttonGroup.children().detach().toArray();
const controls = [
...buttons.map(function (button) {
return {
order: 0,
$el: $(button),
};
}),
...extensions.map(function (extension, i) {
return {
order: extension.order,
index: i,
extension: extension,
};
}),
];

_.sortBy(controls, 'order').forEach(function (control) {
if (control.$el) {
Expand Down

0 comments on commit 61dbbeb

Please sign in to comment.