Skip to content

feat(item): two-way sliding of items#6686

Merged
adamdbradley merged 1 commit intoionic-team:2.0from
manucorporat:sliding-two-way
Jun 8, 2016
Merged

feat(item): two-way sliding of items#6686
adamdbradley merged 1 commit intoionic-team:2.0from
manucorporat:sliding-two-way

Conversation

@manucorporat
Copy link
Contributor

@manucorporat manucorporat commented May 28, 2016

Short description of what this resolves:

Implements: feature(ion-item-sliding): Allow item also to swipe from left to right #5073

it should be 100% back compatible.

Changes proposed in this pull request:

  • adds an optional side attribute to ion-item-options
  • I aggressively refactored the sliding code to try to make it more readable and simple.
  • moved logic to external functions so they can be unit tested easily

This may cause new issues. I haven't tested the code for side effects, so please don't merge just yet.
Feel free to pull it locally and try it.

buenooo

Example code:

    <ion-item-sliding #item>
      <ion-item>Two-way sliding</ion-item>

      <!-- Same: <ion-item-options> -->
      <ion-item-options side="right">
        <button primary (click)="archive(item)">Archive</button>
        <button danger (click)="del(item)">Delete</button>
      </ion-item-options>

      <ion-item-options side="left">
        <button secondary (click)="unread(item)">Unread</button>
      </ion-item-options>
    </ion-item-sliding>

Ionic Version: 2.x

Fixes: #5073

@manucorporat
Copy link
Contributor Author

Documentation is pending

@thomastthai
Copy link

How do I merge this pull request into my own branch? I'm very new to Git. Based on the doc from:

https://help.github.com/articles/checking-out-pull-requests-locally/

There should be a "Merge pull request" button at the bottom of this pull request, but I don't see it.

@manucorporat
Copy link
Contributor Author

manucorporat commented May 30, 2016

@thomastthai try this:

git checkout -b your_local_branch
git pull https://github.com/manucorporat/ionic.git  sliding-two-way

I use the --no-ff option (no fast forward), so you can then easily revert the merge by doing:

git reset --hard HEAD^

@ghenry22
Copy link

Nice work! Would be great to see this get merged, closes one more small gap to the native experience.

* @see {@link ../Item Item API Docs}
* @see {@link ../../list/List List API Docs}
*/
// host: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove any commented code

@@ -1,8 +1,42 @@
import {Component, ElementRef, Optional, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {Component, Directive, Input, Renderer, ContentChildren, ContentChild, ElementRef, Optional, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {NgClass} from '@angular/common';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think NgClass is needed here

@manucorporat manucorporat force-pushed the sliding-two-way branch 6 times, most recently from d42e555 to c2b0947 Compare May 31, 2016 23:26
@manucorporat
Copy link
Contributor Author

new feature:
jun-01-2016 00-47-04

@manucorporat
Copy link
Contributor Author

@adamdbradley @brandyscarney this is ready to be merged!

@manucorporat manucorporat force-pushed the sliding-two-way branch 2 times, most recently from 38b75ce to a4ba0e9 Compare June 4, 2016 17:29
@dylanvdmerwe
Copy link
Contributor

Hi @manucorporat

This is very cool. It definitely goes towards resolving my feature request: #6242

@adamdbradley adamdbradley self-assigned this Jun 8, 2016
@adamdbradley adamdbradley merged commit c28aa53 into ionic-team:2.0 Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants