mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(checkbox): checkbox-square/platform updates
This commit is contained in:
@@ -18,22 +18,22 @@
|
||||
<h1 class="title">Input: Checkbox</h1>
|
||||
</header>
|
||||
|
||||
<main class="content has-header">
|
||||
<ion-content class="content has-header">
|
||||
|
||||
<ul class="list" ng-controller="MainCtrl">
|
||||
<li class="item item-checkbox">
|
||||
<li class="item item-checkbox checkbox-circle">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
Flux Capacitor
|
||||
</li>
|
||||
<li class="item item-checkbox">
|
||||
<li class="item item-checkbox checkbox-square">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
1.21 Gigawatts
|
||||
</li>
|
||||
<li class="item item-checkbox">
|
||||
<li class="item item-checkbox checkbox-platform">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
@@ -70,7 +70,7 @@
|
||||
<ion-checkbox ng-model="test" ng-checked="test" class="checkbox-dark">Dark Directive</ion-checkbox>
|
||||
</ul>
|
||||
|
||||
</main>
|
||||
</ion-content>
|
||||
<script type="text/javascript">
|
||||
angular.module('ionicApp', ['ionic'])
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ describe('Ionic Checkbox', function() {
|
||||
expect(input[0].hasAttribute('checked')).toBe(true);
|
||||
scope.$apply('shouldCheck = false');
|
||||
expect(input[0].hasAttribute('checked')).toBe(false);
|
||||
|
||||
});
|
||||
|
||||
it('should ngChange properly', function() {
|
||||
@@ -72,4 +71,16 @@ describe('Ionic Checkbox', function() {
|
||||
expect(scope.change).toHaveBeenCalledWith(false);
|
||||
});
|
||||
|
||||
it('should add config setting class', inject(function($ionicConfig){
|
||||
$ionicConfig.form.checkbox('square');
|
||||
el = compile('<ion-checkbox>')(scope);
|
||||
scope.$apply();
|
||||
expect(el[0].querySelector('.checkbox').classList.contains('checkbox-square')).toBe(true);
|
||||
|
||||
$ionicConfig.form.checkbox('circle');
|
||||
el = compile('<ion-checkbox>')(scope);
|
||||
scope.$apply();
|
||||
expect(el[0].querySelector('.checkbox').classList.contains('checkbox-circle')).toBe(true);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user