Conflicts:
	dist/js/ionic-angular.min.js
	dist/js/ionic.min.js
This commit is contained in:
Max Lynch
2014-01-13 12:10:30 -06:00
5 changed files with 24 additions and 14 deletions

View File

@@ -1233,16 +1233,17 @@ angular.module('ionic.ui.content', ['ionic.ui.service'])
if(attr.hasSubheader == "true") { element.addClass('has-subheader'); }
if(attr.hasFooter == "true") { element.addClass('has-footer'); }
if(attr.hasTabs == "true") { element.addClass('has-tabs'); }
if(attr.padding == "true") {
var scroll = element.find('.scroll');
if(scroll.length) {
scroll.addClass('padding');
}
}
return function link($scope, $element, $attr) {
var clone, sc, sv,
c = angular.element($element.children()[0]);
// if padding attribute is true, then add padding if it wasn't added to the .scroll
if($scope.$eval($scope.padding) === true) {
c.addClass('padding');
}
if($scope.scroll === "false") {
// No scrolling
return;

View File

File diff suppressed because one or more lines are too long

View File

@@ -47,16 +47,17 @@ angular.module('ionic.ui.content', ['ionic.ui.service'])
if(attr.hasSubheader == "true") { element.addClass('has-subheader'); }
if(attr.hasFooter == "true") { element.addClass('has-footer'); }
if(attr.hasTabs == "true") { element.addClass('has-tabs'); }
if(attr.padding == "true") {
var scroll = element.find('.scroll');
if(scroll.length) {
scroll.addClass('padding');
}
}
return function link($scope, $element, $attr) {
var clone, sc, sv,
c = angular.element($element.children()[0]);
// if padding attribute is true, then add padding if it wasn't added to the .scroll
if($scope.$eval($scope.padding) === true) {
c.addClass('padding');
}
if($scope.scroll === "false") {
// No scrolling
return;

View File

@@ -20,6 +20,14 @@ describe('Ionic Content directive', function() {
expect(element.hasClass('has-header')).toEqual(true);
});
it('should add padding classname', function() {
element = compile('<content padding="true"></content>')(scope);
expect(element.hasClass('scroll-content')).toEqual(true);
expect(element.hasClass('padding')).toEqual(false);
var scrollElement = element.find('.scroll');
expect(scrollElement.hasClass('padding')).toEqual(true);
});
/**
* Not currently possible to mock this AFAIK
*/

View File

@@ -94,7 +94,7 @@
<header class="bar bar-header bar-positive">
<h1 class="title">Deadlines</h1>
</header>
<content has-header="true">
<content has-header="true" padding="true">
<h1>Deadlines</h1>
</content>
</tab>
@@ -103,7 +103,7 @@
<header class="bar bar-header bar-positive">
<h1 class="title">Settings</h1>
</header>
<content has-header="true">
<content has-header="true" padding="true">
<h1>Settings</h1>
</content>
</tab>
@@ -112,7 +112,7 @@
<header class="bar bar-header bar-positive">
<h1 class="title">Settings</h1>
</header>
<content has-header="true">
<content has-header="true" padding="true">
<h1>Settings</h1>
</content>
</tab>