diff --git a/src/components/item/item-sliding.ts b/src/components/item/item-sliding.ts
index 6fc416ffb16..b3c8840dd80 100644
--- a/src/components/item/item-sliding.ts
+++ b/src/components/item/item-sliding.ts
@@ -42,7 +42,7 @@ export const enum ItemSideFlags {
})
export class ItemOptions {
/**
- * @input {string} the side the option button should be on. Defaults to right
+ * @input {string} the side the option button should be on. Defaults to right.
* If you have multiple `ion-item-options`, a side must be provided for each.
*/
@Input() side: string;
@@ -103,7 +103,7 @@ export const enum SlidingState {
* Favorite
* Share
*
-
+ *
*
* Unread
*
@@ -125,7 +125,7 @@ export const enum SlidingState {
* Archive
*
*
-
+ *
*
*
*
@@ -233,6 +233,10 @@ export class ItemSliding {
@ContentChildren(ItemOptions)
set _itemOptions(itemOptions: QueryList) {
let sides = 0;
+
+ // Reset left and right options in case they were removed
+ this._leftOptions = this._rightOptions = null;
+
for (var item of itemOptions.toArray()) {
var side = item.getSides();
if (side === ItemSideFlags.Left) {
@@ -293,10 +297,12 @@ export class ItemSliding {
}
let openAmount = (this._startX - x);
+
switch (this._sides) {
case ItemSideFlags.Right: openAmount = Math.max(0, openAmount); break;
case ItemSideFlags.Left: openAmount = Math.min(0, openAmount); break;
case ItemSideFlags.Both: break;
+ case ItemSideFlags.None: return;
default: assert(false, 'invalid ItemSideFlags value'); break;
}
diff --git a/src/components/item/test/sliding/app-module.ts b/src/components/item/test/sliding/app-module.ts
index 101fa1e5c23..e9e54b51df0 100644
--- a/src/components/item/test/sliding/app-module.ts
+++ b/src/components/item/test/sliding/app-module.ts
@@ -14,6 +14,8 @@ export class E2EPage {
moreText: string = 'Dynamic More';
archiveText: string = 'Dynamic Archive';
+ showOptions: boolean = false;
+
constructor(private nav: NavController, private alertCtrl: AlertController, private toastCtrl: ToastController) {
for (let x = 0; x < 5; x++) {
this.items.push(x);
@@ -28,10 +30,11 @@ export class E2EPage {
if (this.moreText.includes('Dynamic')) {
this.moreText = 'Changed More';
this.archiveText = 'Changed Archive';
-
+ this.showOptions = true;
} else {
this.moreText = 'Dynamic More';
this.archiveText = 'Dynamic Archive';
+ this.showOptions = false;
}
}
diff --git a/src/components/item/test/sliding/main.html b/src/components/item/test/sliding/main.html
index b5a3977b472..fe7af3ce8c5 100644
--- a/src/components/item/test/sliding/main.html
+++ b/src/components/item/test/sliding/main.html
@@ -20,6 +20,50 @@
+
+
+ No Options
+ Should not error or swipe without options
+
+
+
+
+
+ One Line, dynamic option and text
+
+
+
+
+ {{ moreText }}
+
+
+
+ {{ archiveText }}
+
+
+
+
+
+
+ Two options, one dynamic option and text
+
+
+
+
+
+
+
+
+
+ {{ moreText }}
+
+
+
+ {{ archiveText }}
+
+
+
+
HubStruck Notifications
@@ -39,7 +83,7 @@ HubStruck Notifications
-
+
@@ -90,7 +134,6 @@
RIGHT/LEFT side - icons
-
RIGHT/LEFT side - icons (item-left)
@@ -146,21 +189,6 @@ RIGHT/LEFT side - icons (item-left)
-
-
- One Line, dynamic option
-
-
-
-
- {{ moreText }}
-
-
-
- {{ archiveText }}
-
-
-
@@ -240,6 +268,7 @@ ng-for {{data}}
img {
height: 100px;
}
+
#download-spinner {
display: none;
}
@@ -247,10 +276,13 @@ ng-for {{data}}
svg circle {
stroke: white;
}
+
.downloading #download-spinner {
display: block;
}
+
.downloading .download-hide {
display: none;
}
+