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.
This commit is contained in:
Luca Adalberto Vandro 2015-06-17 06:18:52 +02:00
parent 6c9aceb776
commit 93c92cba47

View file

@ -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