More header bar hacking stuff

This commit is contained in:
Max Lynch
2013-09-26 22:46:01 -05:00
parent 64a5e2b435
commit fb18b29aa2
4 changed files with 45 additions and 38 deletions

16
dist/ionic.js vendored
View File

@ -1702,13 +1702,21 @@ ionic.views.HeaderBar = function(opts) {
ionic.views.NavBar.prototype = {
resizeTitle: function() {
var e,
children = this.el.children,
index = Array.prototype.indexOf.call(children, this.el);
var e;
var j;
var children = this.el.children;
for(var i = 0; i < index; i++) {
var title;
var titleWidth;
for(var i = 0; j = children.length; i < j; i++) {
e = children[i];
if(/h\d/.test(e.nodeName.toLowerCase())) {
title = e;
}
}
titleWidth = title.offsetWidth;
}
};
})(window.ionic);

View File

@ -8,13 +8,21 @@ ionic.views.HeaderBar = function(opts) {
ionic.views.NavBar.prototype = {
resizeTitle: function() {
var e,
children = this.el.children,
index = Array.prototype.indexOf.call(children, this.el);
var e;
var j;
var children = this.el.children;
for(var i = 0; i < index; i++) {
var title;
var titleWidth;
for(var i = 0; j = children.length; i < j; i++) {
e = children[i];
if(/h\d/.test(e.nodeName.toLowerCase())) {
title = e;
}
}
titleWidth = title.offsetWidth;
}
};
})(window.ionic);

0
test/headerBarTitle.html Normal file
View File

View File

@ -6,37 +6,28 @@
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="../dist/ionicIcons.css" rel="stylesheet">
<script src="../vendor/angular/1.2.0rc2/angular-1.2.0rc2.min.js"></script>
</head>
<body ng-app ng-controller="AppCtrl">
<body>
<div ng-switch="currentPage">
<section>
<div class="bar bar-header bar-secondary">
<a href="#" class="button button-danger button-clear">Edit</a>
<h1 class="title">World Clock</h1>
<a href="#" class="button button-danger button-clear">Delete</a>
</div>
<div class="content">
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
</div>
</section>
<section id="page2">
<div class="bar bar-header bar-success">
<a href="#" class="button button-danger button-clear">Edit</a>
<h1 class="title">World Clock</h1>
<a href="#" class="button button-danger button-clear">Delete</a>
</div>
<div class="content">
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
</div>
</section>
</div>
<script>
angular.module('test', [])
.controller('AppCtrl', function($scope) {
});
</script>
<section>
<div class="bar bar-header bar-secondary">
<a href="#" class="button button-danger button-clear">Edit</a>
<h1 class="title">World Clock</h1>
<a href="#" class="button button-danger button-clear">Delete</a>
</div>
<div class="content">
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
</div>
</section>
<section id="page2">
<div class="bar bar-header bar-success">
<a href="#" class="button button-danger button-clear">Edit</a>
<h1 class="title">World Clock</h1>
<a href="#" class="button button-danger button-clear">Delete</a>
</div>
<div class="content">
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
</div>
</section>
</body>
</html>