Skip to content

Commit cd0ece7

Browse files
Merge pull request #34 from takenet/feature/add-ngDisable-to-switch
feat(client): using disabled instead ngDisabled
2 parents bc11417 + 5e72c39 commit cd0ece7

4 files changed

Lines changed: 4 additions & 9 deletions

File tree

src/components/switch/SwitchController.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ export default class {
6969
return;
7070
}
7171

72-
if (this.ngDisabled) {
73-
return;
74-
}
75-
7672
if (this.manualToggle) {
7773
event.preventDefault();
7874
this.onToggle();

src/components/switch/SwitchView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<input type="checkbox"
22
ng-checked="$ctrl.isChecked"
3-
ng-readonly="$ctrl.disabled" />
3+
ng-disabled="$ctrl.disabled" />
44
<label ng-click="$ctrl.toggle($event)">
55
<span></span>
66
</label>

src/components/switch/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const SwitchComponent = angular
1717
ngChecked: '=?',
1818
ngTrueValue: '=?',
1919
ngFalseValue: '=?',
20+
disabled: '=?',
2021
ngPermission: '@',
2122
onToggle: '&?',
2223
manualToggle: '@?',

src/components/switch/switch.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import '../../assets/scss/variables';
22

3-
switch {
3+
switch {
44
input[type="checkbox"] {
55
position: absolute;
66
top: 0;
@@ -46,9 +46,7 @@ switch {
4646
}
4747
&:disabled + label {
4848
background: $color-text;
49-
}
50-
51-
49+
}
5250
}
5351
}
5452
.label{

0 commit comments

Comments
 (0)