Skip to content

Instantly share code, notes, and snippets.

@laser
Last active June 20, 2016 15:36
Show Gist options
  • Save laser/efc4aae28ffa83fb1736940e48d76bef to your computer and use it in GitHub Desktop.
Save laser/efc4aae28ffa83fb1736940e48d76bef to your computer and use it in GitHub Desktop.
stickies notes

Changing a Card's groupId

These are all the ways in which a card's groupId can be changed after it's been instantiated.

Receive a card.move message

  • handler: onCardMove

Drop a card onto a card

Note that this applies to reordering cards within a group and also dragging a card from a multi-card group to a different group.

  • group view: initializeDroppable
  • group view: onDrop
  • group model: dropCard
  • group model: insertCards
  • group model: card.set('groupId')

Drop a group onto a group

  • group view: initializeDroppable
  • group view: onDrop
  • group model: dropGroup
  • sheet model: mergeGroups
  • group model: insertCards
  • group model: card.set('groupId')

Drop a card onto a sheet

  • sheet view: initializeDroppable
  • sheet view: onDrop
  • sheet model: dropCard

Get Rid of Leaf-to-Node References

Replace with call to board (or "room")-level service:

  • sheet.board
  • group.sheet
  • card.group

For fast lookups, we can build a hash of entity mappings:

  • sheet id -> board id
  • group id -> sheet id
  • card id -> group id

Can a Card Be Deleted?

Can a Card Be Soft-Deleted?

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