Skip to content

Commit

Permalink
feat(core): add before, after to DirAlias
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Dec 1, 2018
1 parent f8c4a56 commit 66ce443
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/lib/src/style-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ export class LyStyleUtils {
}

getDirection(val: DirAlias) {
if (val === DirAlias.end) {
if (val === DirAlias.start || val === DirAlias.before) {
return this.direction === 'rtl' ? 'right' : 'left';
} else if (val === DirAlias.end || val === DirAlias.after) {
return this.direction === 'rtl' ? 'left' : 'right';
} else {
return this.direction === 'rtl' ? 'right' : 'left';
return val;
}
}
}
Expand All @@ -51,7 +53,9 @@ export enum Dir {
}
export enum DirAlias {
start = 'start',
end = 'end'
end = 'end',
before = 'before',
after = 'after'
}
export enum DirPosition {
left = 'left',
Expand Down

0 comments on commit 66ce443

Please sign in to comment.