mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
Header bar tweaks
This commit is contained in:
@ -9,16 +9,34 @@
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-touch.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-animate.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-sanitize.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header-bar type="bar-primary" align-title="left">
|
||||
<button class="button">Tap</button>
|
||||
<h1 class="title">A really really long title here here here here her</h1>
|
||||
</header-bar>
|
||||
<body ng-controller="TestCtrl">
|
||||
<header-bar
|
||||
title="headerTitle"
|
||||
left-buttons="leftButtons"
|
||||
right-buttons="rightButtons"
|
||||
type="bar-primary"></header-bar>
|
||||
|
||||
<content has-header="true">
|
||||
<input type="text" ng-model="headerTitle">
|
||||
</content>
|
||||
<script src="../../../../dist/js/ionic.js"></script>
|
||||
<script src="../../../../dist/js/ionic-angular.js"></script>
|
||||
<script>
|
||||
angular.module('headerTest', ['ionic']);
|
||||
angular.module('headerTest', ['ionic'])
|
||||
|
||||
.controller('TestCtrl', function($scope) {
|
||||
$scope.headerTitle = 'A really long title here';
|
||||
$scope.leftButtons = [
|
||||
{
|
||||
text: 'Hello',
|
||||
click: function(e) {
|
||||
console.log('Click button');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
var midPoint = window.clientWidth / 2;
|
||||
var box = document.createElement('div');
|
||||
box.style.backgroundColor = 'red';
|
||||
|
||||
@ -6,15 +6,16 @@
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-touch.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-animate.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-touch.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-animate.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-sanitize.js"></script>
|
||||
<script src="../../../../dist/js/ionic.js"></script>
|
||||
<script src="../../../../dist/js/ionic-angular.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pane ng-controller="ModalCtrl">
|
||||
<header-bar type="bar-positive">
|
||||
<h1 class="title">Contacts</h1>
|
||||
<button class="button button-icon" ng-click="openModal()"><i class="icon ion-compose"></i></button>
|
||||
<header-bar type="bar-positive" title="'Contacts'" right-buttons="contactsRightButtons">
|
||||
</header-bar>
|
||||
<content has-header="true">
|
||||
<list>
|
||||
@ -53,8 +54,6 @@
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="../../../../dist/js/ionic.js"></script>
|
||||
<script src="../../../../dist/js/ionic-angular.js"></script>
|
||||
<script>
|
||||
angular.module('modalTest', ['ionic'])
|
||||
|
||||
@ -64,6 +63,15 @@
|
||||
{ name: 'Barney Calhoun' },
|
||||
{ name: 'Lamarr the Headcrab' },
|
||||
];
|
||||
$scope.contactsRightButtons = [
|
||||
{
|
||||
type: 'button-icon',
|
||||
content: '<i class="icon ion-compose"></i>',
|
||||
click: function(e) {
|
||||
$scope.openModal();
|
||||
}
|
||||
}
|
||||
];
|
||||
$scope.openModal = function() {
|
||||
$scope.modal.show();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user