diff --git a/src/components/item/item-options.ts b/src/components/item/item-options.ts index 781a6bf60e..3d9646a6a3 100644 --- a/src/components/item/item-options.ts +++ b/src/components/item/item-options.ts @@ -1,5 +1,6 @@ import { Directive, ElementRef, EventEmitter, Input, Output, Renderer } from '@angular/core'; +import { Platform } from '../../platform/platform'; import { isPresent} from '../../util/util'; import { ITEM_SIDE_FLAG_LEFT, ITEM_SIDE_FLAG_RIGHT, ItemSliding } from './item-sliding'; @@ -39,16 +40,25 @@ export class ItemOptions { */ @Output() ionSwipe: EventEmitter = new EventEmitter(); - constructor(private _elementRef: ElementRef, private _renderer: Renderer) {} + constructor(private _elementRef: ElementRef, private _renderer: Renderer, private _plt: Platform) {} /** * @hidden */ getSides(): number { - if (isPresent(this.side) && this.side === 'left') { - return ITEM_SIDE_FLAG_LEFT; + if (isPresent(this.side)) { + switch (this.side) { + case 'left': + return ITEM_SIDE_FLAG_LEFT; + case 'right': + return ITEM_SIDE_FLAG_RIGHT; + case 'start': + return this._plt.isRTL() ? ITEM_SIDE_FLAG_RIGHT : ITEM_SIDE_FLAG_LEFT; + case 'end': + return this._plt.isRTL() ? ITEM_SIDE_FLAG_LEFT : ITEM_SIDE_FLAG_RIGHT; + } } - return ITEM_SIDE_FLAG_RIGHT; + return this._plt.isRTL() ? ITEM_SIDE_FLAG_LEFT : ITEM_SIDE_FLAG_RIGHT; } /**