mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
remove link-item tests
This commit is contained in:
@@ -365,35 +365,3 @@ describe('Ionic Item Directive', function () {
|
||||
|
||||
});
|
||||
|
||||
describe('Ionic Link Item Directive', function () {
|
||||
var $rootScope, $compile, listCtrl, options, listScope, itemScope, listElement, itemElement;
|
||||
|
||||
beforeEach(module('ionic.ui.list'));
|
||||
|
||||
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
||||
$rootScope = _$rootScope_;
|
||||
$compile = _$compile_;
|
||||
|
||||
listElement = angular.element('<list>');
|
||||
listElement = _$compile_(listElement)($rootScope);
|
||||
listScope = listElement.isolateScope();
|
||||
|
||||
listCtrl = listElement.controller('list');
|
||||
|
||||
itemElement = angular.element('<link-item>').appendTo(listElement);
|
||||
itemElement = _$compile_(itemElement)($rootScope);
|
||||
|
||||
$rootScope.$digest();
|
||||
itemScope = itemElement.isolateScope();
|
||||
}));
|
||||
|
||||
it('Should set link-item href', inject(function ($timeout) {
|
||||
itemElement = angular.element('<link-item href="http://drifty.com/">').appendTo(listElement);
|
||||
itemElement = $compile(itemElement)($rootScope);
|
||||
$rootScope.$digest();
|
||||
itemScope = itemElement.isolateScope();
|
||||
expect(itemScope.href).toBe("http://drifty.com/");
|
||||
expect(itemElement.attr('href')).toBe("http://drifty.com/");
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
@@ -58,16 +58,16 @@
|
||||
<content has-header="true"
|
||||
on-refresh-holding="refreshHolding()"
|
||||
on-refresh-opening="refreshOpening(ratio)"
|
||||
on-refresh="refreshItems()"
|
||||
refresh-complete="refreshComplete">
|
||||
on-refresh="refreshItems()">
|
||||
|
||||
<list show-delete="isDeletingItems" animation="my-repeat-animation">
|
||||
<list show-delete="isDeletingItems"
|
||||
animation="my-repeat-animation"
|
||||
on-delete="deleteListItem(item)">
|
||||
|
||||
<refresher></refresher>
|
||||
|
||||
<item ng-repeat="item in items"
|
||||
item="item"
|
||||
on-delete="deleteListItem(item)">
|
||||
item="item">
|
||||
Item: {{ item.text }}
|
||||
</item>
|
||||
|
||||
|
||||
@@ -61,25 +61,29 @@
|
||||
|
||||
<tab title="Home" icon-on="icon ion-ios7-filing" icon-off="icon ion-ios7-filing-outline" ng-controller="HomeCtrl">
|
||||
<header class="bar bar-header bar-positive">
|
||||
<button class="button button-icon" ng-click="newTask()"><i class="icon ion-navicon-round"></i></button>
|
||||
<button class="button button-icon" ng-click="newTask()"><i class="icon ion-plus"></i></button>
|
||||
<h1 class="title">Tasks</h1>
|
||||
<button class="button button-clear button-primary" ng-click="isEditingItems = !isEditingItems">Edit</button>
|
||||
<button class="button button-clear" ng-click="isDeletingItems = !isDeletingItems">Edit</button>
|
||||
</header>
|
||||
<content has-header="true" has-tabs="true" on-refresh="onRefresh()" on-scroll="scroll(scrollTop, scrollLeft)">
|
||||
|
||||
<refresher></refresher>
|
||||
<list scroll="false" on-refresh="onRefresh()" on-reorder="onReorder(el, start, end)" is-editing="isEditingItems" animation="fade-out" delete-icon="icon ion-minus-circled" reorder-icon="icon ion-navicon">
|
||||
|
||||
<list scroll="false"
|
||||
on-reorder="onReorder(el, start, end)"
|
||||
can-delete="true"
|
||||
can-reorder="true"
|
||||
can-swipe="true"
|
||||
on-delete="deleteItem(item)"
|
||||
show-delete="isDeletingItems"
|
||||
animation="fade-out"
|
||||
delete-icon="ion-minus-circled"
|
||||
reorder-icon="ion-navicon">
|
||||
|
||||
<item ng-repeat="item in items"
|
||||
item="item"
|
||||
buttons="item.buttons"
|
||||
can-delete="true"
|
||||
can-reorder="true"
|
||||
can-swipe="true"
|
||||
on-delete="deleteItem(item)"
|
||||
ng-class="{completed: item.isCompleted}"
|
||||
>
|
||||
item="item"
|
||||
ng-class="{completed: item.isCompleted}">
|
||||
{{item.title}}
|
||||
<i class="{{item.icon}}"></i>
|
||||
</list-item>
|
||||
</list>
|
||||
</content>
|
||||
@@ -102,14 +106,7 @@
|
||||
<h1>Settings</h1>
|
||||
</content>
|
||||
</tab>
|
||||
<tab title="Settings" icon-on="icon ion-ios7-gear" icon-off="icon ion-ios7-gear-outline">
|
||||
<header class="bar bar-header bar-positive">
|
||||
<h1 class="title">Settings</h1>
|
||||
</header>
|
||||
<content has-header="true">
|
||||
<h1>Settings</h1>
|
||||
</content>
|
||||
</tab>
|
||||
|
||||
<tab title="Settings" icon-on="icon ion-ios7-gear" icon-off="icon ion-ios7-gear-outline">
|
||||
<header class="bar bar-header bar-positive">
|
||||
<h1 class="title">Settings</h1>
|
||||
@@ -149,7 +146,6 @@
|
||||
|
||||
|
||||
.controller('HomeCtrl', function($scope, $timeout, Modal, ActionSheet) {
|
||||
$scope.items = [];
|
||||
|
||||
Modal.fromTemplateUrl('newTask.html', function(modal) {
|
||||
$scope.settingsModal = modal;
|
||||
@@ -182,6 +178,7 @@
|
||||
console.log('ON REFRESH');
|
||||
|
||||
$timeout(function() {
|
||||
buildMockData();
|
||||
$scope.$broadcast('scroll.refreshComplete');
|
||||
}, 1000);
|
||||
}
|
||||
@@ -195,21 +192,16 @@
|
||||
$scope.settingsModal.show();
|
||||
};
|
||||
|
||||
// Create the items
|
||||
for(var i = 0; i < 25; i++) {
|
||||
$scope.items.push({
|
||||
title: 'Task ' + (i + 1),
|
||||
buttons: [{
|
||||
text: 'Done',
|
||||
type: 'button-success',
|
||||
onButtonClicked: completeItem,
|
||||
}, {
|
||||
text: 'Delete',
|
||||
type: 'button-danger',
|
||||
onButtonClicked: removeItem,
|
||||
}]
|
||||
});
|
||||
function buildMockData() {
|
||||
// Create the items
|
||||
$scope.items = [];
|
||||
for(var i = 0; i < 25; i++) {
|
||||
$scope.items.push({
|
||||
title: 'Task ' + (i + 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
buildMockData();
|
||||
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user