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 = {
|
ionic.views.NavBar.prototype = {
|
||||||
resizeTitle: function() {
|
resizeTitle: function() {
|
||||||
var e,
|
var e;
|
||||||
children = this.el.children,
|
var j;
|
||||||
index = Array.prototype.indexOf.call(children, this.el);
|
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];
|
e = children[i];
|
||||||
|
if(/h\d/.test(e.nodeName.toLowerCase())) {
|
||||||
|
title = e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
titleWidth = title.offsetWidth;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(window.ionic);
|
})(window.ionic);
|
||||||
|
|||||||
@ -8,13 +8,21 @@ ionic.views.HeaderBar = function(opts) {
|
|||||||
|
|
||||||
ionic.views.NavBar.prototype = {
|
ionic.views.NavBar.prototype = {
|
||||||
resizeTitle: function() {
|
resizeTitle: function() {
|
||||||
var e,
|
var e;
|
||||||
children = this.el.children,
|
var j;
|
||||||
index = Array.prototype.indexOf.call(children, this.el);
|
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];
|
e = children[i];
|
||||||
|
if(/h\d/.test(e.nodeName.toLowerCase())) {
|
||||||
|
title = e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
titleWidth = title.offsetWidth;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(window.ionic);
|
})(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 -->
|
<!-- Sets initial viewport load and disables zooming -->
|
||||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link href="../dist/ionicIcons.css" rel="stylesheet">
|
<link href="../dist/ionicIcons.css" rel="stylesheet">
|
||||||
<script src="../vendor/angular/1.2.0rc2/angular-1.2.0rc2.min.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body ng-app ng-controller="AppCtrl">
|
<body>
|
||||||
|
|
||||||
<div ng-switch="currentPage">
|
<section>
|
||||||
<section>
|
<div class="bar bar-header bar-secondary">
|
||||||
<div class="bar bar-header bar-secondary">
|
<a href="#" class="button button-danger button-clear">Edit</a>
|
||||||
<a href="#" class="button button-danger button-clear">Edit</a>
|
<h1 class="title">World Clock</h1>
|
||||||
<h1 class="title">World Clock</h1>
|
<a href="#" class="button button-danger button-clear">Delete</a>
|
||||||
<a href="#" class="button button-danger button-clear">Delete</a>
|
</div>
|
||||||
</div>
|
<div class="content">
|
||||||
<div class="content">
|
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
|
||||||
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</section>
|
<section id="page2">
|
||||||
<section id="page2">
|
<div class="bar bar-header bar-success">
|
||||||
<div class="bar bar-header bar-success">
|
<a href="#" class="button button-danger button-clear">Edit</a>
|
||||||
<a href="#" class="button button-danger button-clear">Edit</a>
|
<h1 class="title">World Clock</h1>
|
||||||
<h1 class="title">World Clock</h1>
|
<a href="#" class="button button-danger button-clear">Delete</a>
|
||||||
<a href="#" class="button button-danger button-clear">Delete</a>
|
</div>
|
||||||
</div>
|
<div class="content">
|
||||||
<div class="content">
|
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
|
||||||
<div style="width: 100%; background-color: #ccc; height: 2000px"></div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
angular.module('test', [])
|
|
||||||
|
|
||||||
.controller('AppCtrl', function($scope) {
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user