From 93c92cba47d20c33816518e7ca0baf52cb2963f6 Mon Sep 17 00:00:00 2001 From: Luca Adalberto Vandro Date: Wed, 17 Jun 2015 06:18:52 +0200 Subject: [PATCH] Update ionHeaderBar.js Handle the case when there's more than a single button on both sides of the bar. It should fix #100 and #182 and it could be a more general solution. --- components/ionHeaderBar/ionHeaderBar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/ionHeaderBar/ionHeaderBar.js b/components/ionHeaderBar/ionHeaderBar.js index ddd7263..ec06d01 100644 --- a/components/ionHeaderBar/ionHeaderBar.js +++ b/components/ionHeaderBar/ionHeaderBar.js @@ -27,10 +27,14 @@ IonHeaderBar = { var leftButtonWidth = 0; var rightButtonWidth = 0; if ($leftButton.length) { - leftButtonWidth = $leftButton.outerWidth(); + $leftButton.each(function(index, element){ + leftButtonWidth += $(element).outerWidth(); + }); } if ($rightButton.length) { - rightButtonWidth = $rightButton.outerWidth(); + $rightButton.each(function(index, element){ + rightButtonWidth += $(element).outerWidth(); + }); } // If we're on Android, we only care about the left button