Removed ng-class on list item to not clash with user's use of ng-class

This commit is contained in:
Max Lynch
2014-01-12 20:24:44 -06:00
parent e9cb20e57a
commit c5c68c2bf1
7 changed files with 25 additions and 11 deletions

1
dist/css/ionic.css vendored
View File

@@ -1,3 +1,4 @@
@charset "UTF-8";
/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/

View File

@@ -1,4 +1,4 @@
/*!
@charset "UTF-8";/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*

View File

@@ -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") {

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -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") {

View File

@@ -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);
}));