Skip to content

Commit

Permalink
fix(headerBarView): check for null in getTextBounds
Browse files Browse the repository at this point in the history
In Android <= 4.3, getBoundingClientRect does not return a rect for a
text node, closes #1377.
  • Loading branch information
Adam Bradley committed Jun 16, 2014
1 parent a0b61e0 commit be351ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/views/headerBarView.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@

childSize = null;
if(c.nodeType == 3) {
childSize = ionic.DomUtil.getTextBounds(c).width;
var bounds = ionic.DomUtil.getTextBounds(c);
if(bounds) {
childSize = bounds.width;
}
} else if(c.nodeType == 1) {
childSize = c.offsetWidth;
}
Expand Down

0 comments on commit be351ce

Please sign in to comment.