Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

moved action doesn't get triggered on controller  #12

Open

Description

@guatedude2

Hi @omghax I tested out the component with your fix. Seems like the action target object is the content item.

This is my example where content is a list of items in a model:

// app/templates/card-view.hbs
{{#collection "ivy-sortable" content=content moved="moveCard" revert="200" }}
  {{card details=this}}
{{/collection}}
// app/controllers/card-view.js
  import Ember from 'ember';

  export default Ember.ArrayController.extend({
    actions: {
      moveCard(card, oldIndex, newIndex) {
        console.log("CARD MOVED", card, oldIndex, newIndex);
      }
    }
  });

and the debug of sendAction is Line 80 in ivy_sortable/views/ivy-sortable.js

this.triggerAction({
  action: actionName, //this is "moveCard"
  actionContext: contexts //this is an individual card model
});

So the controller moveCard doesnt work

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions