mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Removed ng-class on list item to not clash with user's use of ng-class
This commit is contained in:
1
dist/css/ionic.css
vendored
1
dist/css/ionic.css
vendored
@@ -1,3 +1,4 @@
|
||||
@charset "UTF-8";
|
||||
/*!
|
||||
* Copyright 2014 Drifty Co.
|
||||
* http://drifty.com/
|
||||
|
||||
2
dist/css/ionic.min.css
vendored
2
dist/css/ionic.min.css
vendored
@@ -1,4 +1,4 @@
|
||||
/*!
|
||||
@charset "UTF-8";/*!
|
||||
* Copyright 2014 Drifty Co.
|
||||
* http://drifty.com/
|
||||
*
|
||||
|
||||
11
dist/js/ionic-angular.js
vendored
11
dist/js/ionic-angular.js
vendored
@@ -1390,7 +1390,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
reorderIcon: '@'
|
||||
},
|
||||
|
||||
template: '<div class="item item-complex" ng-class="itemClass">\
|
||||
template: '<div class="item item-complex">\
|
||||
<div class="item-edit" ng-if="deleteClick !== undefined">\
|
||||
<button class="button button-icon icon" ng-class="deleteIconClass" ng-click="deleteClick()"></button>\
|
||||
</div>\
|
||||
@@ -1413,8 +1413,15 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
if(value) $scope.href = value.trim();
|
||||
});
|
||||
|
||||
if(!$scope.itemType) {
|
||||
$scope.itemType = $parentScope.itemType;
|
||||
}
|
||||
|
||||
// Set this item's class, first from the item directive attr, and then the list attr if item not set
|
||||
$scope.itemClass = $scope.itemType || $parentScope.itemType;
|
||||
$element.addClass($scope.itemType || $parentScope.itemType);
|
||||
|
||||
$scope.itemClass = $scope.itemType;
|
||||
|
||||
// Decide if this item can do stuff, and follow a certain priority
|
||||
// depending on where the value comes from
|
||||
if(($attr.canDelete ? $scope.canDelete : $parentScope.canDelete) !== "false") {
|
||||
|
||||
4
dist/js/ionic-angular.min.js
vendored
4
dist/js/ionic-angular.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/ionic.min.js
vendored
4
dist/js/ionic.min.js
vendored
File diff suppressed because one or more lines are too long
11
js/ext/angular/src/directive/ionicList.js
vendored
11
js/ext/angular/src/directive/ionicList.js
vendored
@@ -22,7 +22,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
reorderIcon: '@'
|
||||
},
|
||||
|
||||
template: '<div class="item item-complex" ng-class="itemClass">\
|
||||
template: '<div class="item item-complex">\
|
||||
<div class="item-edit" ng-if="deleteClick !== undefined">\
|
||||
<button class="button button-icon icon" ng-class="deleteIconClass" ng-click="deleteClick()"></button>\
|
||||
</div>\
|
||||
@@ -45,8 +45,15 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
if(value) $scope.href = value.trim();
|
||||
});
|
||||
|
||||
if(!$scope.itemType) {
|
||||
$scope.itemType = $parentScope.itemType;
|
||||
}
|
||||
|
||||
// Set this item's class, first from the item directive attr, and then the list attr if item not set
|
||||
$scope.itemClass = $scope.itemType || $parentScope.itemType;
|
||||
$element.addClass($scope.itemType || $parentScope.itemType);
|
||||
|
||||
$scope.itemClass = $scope.itemType;
|
||||
|
||||
// Decide if this item can do stuff, and follow a certain priority
|
||||
// depending on where the value comes from
|
||||
if(($attr.canDelete ? $scope.canDelete : $parentScope.canDelete) !== "false") {
|
||||
|
||||
@@ -92,7 +92,7 @@ describe('Ionic Item Directive', function () {
|
||||
itemElement = $compile(itemElement)($rootScope);
|
||||
$rootScope.$digest();
|
||||
itemScope = itemElement.isolateScope();
|
||||
expect(itemScope.itemClass).toBe("item-type-test");
|
||||
expect(itemScope.itemType).toBe("item-type-test");
|
||||
expect(itemElement.hasClass('item-type-test')).toBe(true);
|
||||
}));
|
||||
|
||||
@@ -103,7 +103,6 @@ describe('Ionic Item Directive', function () {
|
||||
itemElement = $compile(itemElement)($rootScope);
|
||||
$rootScope.$digest();
|
||||
itemScope = itemElement.isolateScope();
|
||||
expect(itemScope.itemClass).toBe('list-item-type-test');
|
||||
expect(itemElement.hasClass('list-item-type-test')).toBe(true);
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user