mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
More header bar hacking stuff
This commit is contained in:
16
dist/ionic.js
vendored
16
dist/ionic.js
vendored
@ -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);
|
||||
|
||||
@ -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
0
test/headerBarTitle.html
Normal 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>
|
||||
|
||||
Reference in New Issue
Block a user