Skip to content

Commit

Permalink
chore(*): address some review comments #4679
Browse files Browse the repository at this point in the history
  • Loading branch information
SAndreeva committed Jun 6, 2019
1 parent 7ec5876 commit 9341d82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1550,8 +1550,10 @@ export class IgxTimePickerComponent implements
* @hidden
*/
public parseMask(preserveAmPm = true): string {
return preserveAmPm ? this.mask.replace(new RegExp('0', 'g'), this.promptChar).replace('LL', 'AM') :
this.mask.replace(new RegExp('0', 'g'), this.promptChar).replace(new RegExp('L', 'g'), this.promptChar);
const maskWithAmPm = this.mask.replace(new RegExp('0', 'g'), this.promptChar).replace('LL', 'AM');
const pureMask = this.mask.replace(new RegExp('0', 'g'), this.promptChar).replace(new RegExp('L', 'g'), this.promptChar);

return preserveAmPm ? maskWithAmPm : pureMask;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,9 @@ export class IgxItemListDirective {

const listName = (event.target as HTMLElement).className;

if (listName.indexOf('hourList') !== -1) {
if (this.timePicker.minuteList) {
this.timePicker.minuteList.nativeElement.focus();
} else if (this.timePicker.ampmList) {
this.timePicker.ampmList.nativeElement.focus();
}
}

if (listName.indexOf('minuteList') !== -1 && this.timePicker.ampmList) {
if (listName.indexOf('hourList') !== -1 && this.timePicker.minuteList) {
this.timePicker.minuteList.nativeElement.focus();
} else if ((listName.indexOf('hourList') !== -1 || listName.indexOf('minuteList') !== -1) && this.timePicker.ampmList) {
this.timePicker.ampmList.nativeElement.focus();
}
}
Expand All @@ -148,17 +142,11 @@ export class IgxItemListDirective {

const listName = (event.target as HTMLElement).className;

if (listName.indexOf('minuteList') !== -1 && this.timePicker.hourList) {
if (listName.indexOf('ampmList') !== -1 && this.timePicker.minuteList) {
this.timePicker.minuteList.nativeElement.focus();
} else if ((listName.indexOf('ampmList') !== -1 || listName.indexOf('minuteList') !== -1) && this.timePicker.hourList) {
this.timePicker.hourList.nativeElement.focus();
}

if (listName.indexOf('ampmList') !== -1) {
if (this.timePicker.minuteList) {
this.timePicker.minuteList.nativeElement.focus();
} else if (this.timePicker.hourList) {
this.timePicker.hourList.nativeElement.focus();
}
}
}

/**
Expand Down

0 comments on commit 9341d82

Please sign in to comment.