mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Simpler content area and fixed nav ctrl
This commit is contained in:
10
dist/css/ionic-ios7.css
vendored
10
dist/css/ionic-ios7.css
vendored
@ -367,15 +367,7 @@ body, .ionic-body {
|
||||
-webkit-transform: translateZ(0px);
|
||||
transform: translateZ(0px); }
|
||||
|
||||
.content-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-overflow-scrolling: touch; }
|
||||
|
||||
.content-plain {
|
||||
.content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
|
||||
9
dist/css/ionic-scoped.css
vendored
9
dist/css/ionic-scoped.css
vendored
@ -1139,14 +1139,7 @@
|
||||
.ionic .content > * {
|
||||
-webkit-transform: translateZ(0px);
|
||||
transform: translateZ(0px); }
|
||||
.ionic .content-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-overflow-scrolling: touch; }
|
||||
.ionic .content-plain {
|
||||
.ionic .content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
|
||||
10
dist/css/ionic.css
vendored
10
dist/css/ionic.css
vendored
@ -1446,15 +1446,7 @@ body, .ionic-body {
|
||||
-webkit-transform: translateZ(0px);
|
||||
transform: translateZ(0px); }
|
||||
|
||||
.content-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-overflow-scrolling: touch; }
|
||||
|
||||
.content-plain {
|
||||
.content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
|
||||
30
dist/js/ionic-angular.js
vendored
30
dist/js/ionic-angular.js
vendored
@ -340,13 +340,12 @@ angular.module('ionic.ui.content', [])
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
template: '<div class="content-wrapper"><div class="content"></div></div>',
|
||||
template: '<div class="content"></div>',
|
||||
transclude: true,
|
||||
compile: function(element, attr, transclude) {
|
||||
return function($scope, $element, $attr) {
|
||||
var c = $element.children().eq(0);
|
||||
var c = $element.eq(0);
|
||||
|
||||
c.addClass('content');
|
||||
|
||||
if(attr.hasHeader) {
|
||||
c.addClass('has-header');
|
||||
@ -357,7 +356,8 @@ angular.module('ionic.ui.content', [])
|
||||
if(attr.hasTabs) {
|
||||
c.addClass('has-tabs');
|
||||
}
|
||||
c.append(transclude($scope));
|
||||
var e = transclude($scope);
|
||||
console.log(e);
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -531,27 +531,31 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
||||
this.endDrag = function(e) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Push a template onto the navigation stack.
|
||||
* @param {string} templateUrl the URL of the template to load.
|
||||
*/
|
||||
this.pushFromTemplate = function(templateUrl) {
|
||||
var childScope = $scope.$new();
|
||||
childScope.isVisible = true;
|
||||
|
||||
// Load the given template
|
||||
TemplateLoader.load(templateUrl).then(function(templateString) {
|
||||
|
||||
// Compile the template with the new scrope, and append it to the navigation's content area
|
||||
var el = $compile(templateString)(childScope, function(cloned, scope) {
|
||||
angular.element($element[0].children[1].firstElementChild).append(cloned);
|
||||
var content = $element[0].querySelector('.content');
|
||||
angular.element(content).append(cloned);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Push a controller to the stack. This is called by the child
|
||||
* nav-content directive when it is linked to a scope on the page.
|
||||
*/
|
||||
$scope.pushController = function(scope, element) {
|
||||
_this.push(scope);
|
||||
|
||||
/*
|
||||
var old = angular.element($element[0].children[1]);
|
||||
$animate.enter(element, $element, $element[0].firstElementChild, function() {
|
||||
});
|
||||
$animate.leave(old, function() {
|
||||
});
|
||||
*/
|
||||
};
|
||||
|
||||
$scope.navController = this;
|
||||
|
||||
8
js/ext/angular/src/directive/ionicContent.js
vendored
8
js/ext/angular/src/directive/ionicContent.js
vendored
@ -9,13 +9,12 @@ angular.module('ionic.ui.content', [])
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
template: '<div class="content-wrapper"><div class="content"></div></div>',
|
||||
template: '<div class="content"></div>',
|
||||
transclude: true,
|
||||
compile: function(element, attr, transclude) {
|
||||
return function($scope, $element, $attr) {
|
||||
var c = $element.children().eq(0);
|
||||
var c = $element.eq(0);
|
||||
|
||||
c.addClass('content');
|
||||
|
||||
if(attr.hasHeader) {
|
||||
c.addClass('has-header');
|
||||
@ -26,7 +25,8 @@ angular.module('ionic.ui.content', [])
|
||||
if(attr.hasTabs) {
|
||||
c.addClass('has-tabs');
|
||||
}
|
||||
c.append(transclude($scope));
|
||||
var e = transclude($scope);
|
||||
console.log(e);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
22
js/ext/angular/src/directive/ionicNav.js
vendored
22
js/ext/angular/src/directive/ionicNav.js
vendored
@ -34,27 +34,31 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
||||
this.endDrag = function(e) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Push a template onto the navigation stack.
|
||||
* @param {string} templateUrl the URL of the template to load.
|
||||
*/
|
||||
this.pushFromTemplate = function(templateUrl) {
|
||||
var childScope = $scope.$new();
|
||||
childScope.isVisible = true;
|
||||
|
||||
// Load the given template
|
||||
TemplateLoader.load(templateUrl).then(function(templateString) {
|
||||
|
||||
// Compile the template with the new scrope, and append it to the navigation's content area
|
||||
var el = $compile(templateString)(childScope, function(cloned, scope) {
|
||||
angular.element($element[0].children[1].firstElementChild).append(cloned);
|
||||
var content = $element[0].querySelector('.content');
|
||||
angular.element(content).append(cloned);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Push a controller to the stack. This is called by the child
|
||||
* nav-content directive when it is linked to a scope on the page.
|
||||
*/
|
||||
$scope.pushController = function(scope, element) {
|
||||
_this.push(scope);
|
||||
|
||||
/*
|
||||
var old = angular.element($element[0].children[1]);
|
||||
$animate.enter(element, $element, $element[0].firstElementChild, function() {
|
||||
});
|
||||
$animate.leave(old, function() {
|
||||
});
|
||||
*/
|
||||
};
|
||||
|
||||
$scope.navController = this;
|
||||
|
||||
@ -70,27 +70,14 @@ body, .ionic-body {
|
||||
transform: translateZ(0px);
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.content-plain {
|
||||
.content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
&.has-header {
|
||||
}
|
||||
|
||||
&.has-footer {
|
||||
}
|
||||
}
|
||||
|
||||
// Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
|
||||
|
||||
Reference in New Issue
Block a user