Skip to content

Commit

Permalink
Fixed #883
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Sep 12, 2016
1 parent 4b71182 commit c2be13e
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ export class AutoComplete implements AfterViewInit,DoCheck,AfterViewChecked,Cont
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

onInput(event) {
let value = event.target.value;
if(!this.multiple) {
Expand Down
4 changes: 4 additions & 0 deletions components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export class Calendar implements AfterViewInit,OnChanges,OnDestroy,ControlValueA
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

ngOnChanges(changes: {[key: string]: SimpleChange}) {
if (this.initialized) {
Expand Down
4 changes: 4 additions & 0 deletions components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export class Checkbox implements ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}
}

@NgModule({
Expand Down
4 changes: 4 additions & 0 deletions components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ export class Dropdown implements OnInit,AfterViewInit,AfterViewChecked,DoCheck,O
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

updateDimensions() {
if(this.autoWidth) {
Expand Down
4 changes: 4 additions & 0 deletions components/inputmask/inputmask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export class InputMask implements AfterViewInit,OnDestroy,ControlValueAccessor {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

onBlur() {
this.onModelTouched();
}
Expand Down
4 changes: 4 additions & 0 deletions components/inputswitch/inputswitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ export class InputSwitch implements ControlValueAccessor, AfterViewInit {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}
}

@NgModule({
Expand Down
6 changes: 5 additions & 1 deletion components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Listbox implements ControlValueAccessor {

@Input() styleClass: string;

@Input() disabled: string;
@Input() disabled: boolean;

@Output() onChange: EventEmitter<any> = new EventEmitter();

Expand Down Expand Up @@ -66,6 +66,10 @@ export class Listbox implements ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

onOptionClick(event, option) {
let metaKey = (event.metaKey||event.ctrlKey);
Expand Down
4 changes: 4 additions & 0 deletions components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ export class MultiSelect implements OnInit,AfterViewInit,AfterViewChecked,DoChec
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

onItemClick(event, value) {
let selectionIndex = this.findSelectionIndex(value);
if(selectionIndex != -1) {
Expand Down
4 changes: 4 additions & 0 deletions components/radiobutton/radiobutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export class RadioButton implements ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}
}

@NgModule({
Expand Down
4 changes: 4 additions & 0 deletions components/rating/rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export class Rating implements ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}
}

@NgModule({
Expand Down
4 changes: 4 additions & 0 deletions components/selectbutton/selectbutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export class SelectButton implements ControlValueAccessor {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

onItemClick(event, option: SelectItem) {
if(this.disabled) {
return;
Expand Down
4 changes: 4 additions & 0 deletions components/slider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export class Slider implements AfterViewInit,OnDestroy,OnChanges,ControlValueAcc
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}

ngOnChanges(changes: { [key: string]: SimpleChange }) {
if (this.initialized) {
Expand Down
4 changes: 4 additions & 0 deletions components/spinner/spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ export class Spinner implements AfterViewInit,ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}
}


Expand Down
4 changes: 4 additions & 0 deletions components/togglebutton/togglebutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export class ToggleButton implements ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

setDisabledState(val: boolean): void {
this.disabled = val;
}
}

@NgModule({
Expand Down

0 comments on commit c2be13e

Please sign in to comment.