mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Real fix for #444 with passing test
This commit is contained in:
3
dist/js/ionic.js
vendored
3
dist/js/ionic.js
vendored
@@ -5819,8 +5819,9 @@ ionic.views.TabBar = ionic.views.View.inherit({
|
||||
},
|
||||
|
||||
tap: function(e) {
|
||||
if(!this.el.disabled)
|
||||
if(this.el.getAttribute('disabled') !== 'disabled') {
|
||||
this.val( !this.checkbox.checked );
|
||||
}
|
||||
},
|
||||
|
||||
drag: function(e) {
|
||||
|
||||
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
@@ -27,18 +27,22 @@ describe('Ionic Toggle', function() {
|
||||
|
||||
it('Should disable and enable', function() {
|
||||
|
||||
el = compile('<toggle ng-model="data.name" ng-disabled="isDisabled"></toggle>')(rootScope);
|
||||
rootScope.data = { isDisabled: false };
|
||||
el = compile('<toggle ng-model="data.name" ng-disabled="data.isDisabled"></toggle>')(rootScope);
|
||||
var toggle = el.isolateScope().toggle;
|
||||
expect(toggle.val()).toBe(false);
|
||||
el.click();
|
||||
expect(toggle.val()).toBe(true);
|
||||
|
||||
$rootScope.isDisabled = true;
|
||||
rootScope.data.isDisabled = true;
|
||||
rootScope.$apply();
|
||||
expect(toggle.el.getAttribute('disabled')).toBe('disabled');
|
||||
el.click();
|
||||
expect(toggle.val()).toBe(true);
|
||||
|
||||
$rootScope.isDisabled = false;
|
||||
rootScope.data.isDisabled = false;
|
||||
rootScope.$apply();
|
||||
el.click();
|
||||
expect(toggle.val()).toBe(false);
|
||||
expect(toggle.el.getAttribute('disabled')).not.toBe('disabled');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
},
|
||||
|
||||
tap: function(e) {
|
||||
if(!this.el.disabled)
|
||||
if(this.el.getAttribute('disabled') !== 'disabled') {
|
||||
this.val( !this.checkbox.checked );
|
||||
}
|
||||
},
|
||||
|
||||
drag: function(e) {
|
||||
|
||||
Reference in New Issue
Block a user