mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' of https://github.com/driftyco/ionic
Conflicts: dist/js/ionic-angular.min.js dist/js/ionic.min.js
This commit is contained in:
11
dist/js/ionic-angular.js
vendored
11
dist/js/ionic-angular.js
vendored
@@ -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;
|
||||
|
||||
2
dist/js/ionic-angular.min.js
vendored
2
dist/js/ionic-angular.min.js
vendored
File diff suppressed because one or more lines are too long
11
js/ext/angular/src/directive/ionicContent.js
vendored
11
js/ext/angular/src/directive/ionicContent.js
vendored
@@ -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;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user