mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
343e592569
Summary: Adds the draft list using a refactored list-tabular class. Also fixes several draft bugs that appeared after allowing editing. Test Plan: Run tests (need to test new ListTabular component ASAP) Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1272
29 lines
508 B
CoffeeScript
29 lines
508 B
CoffeeScript
React = require "react"
|
|
Reflux = require 'reflux'
|
|
Actions = require './flux/actions'
|
|
Sheet = require './sheet'
|
|
|
|
SheetStore = Reflux.createStore
|
|
init: ->
|
|
@_stack = []
|
|
@pushSheet(<Sheet type="Root" depth=0 key="0" />)
|
|
|
|
@listenTo Actions.popSheet, @popSheet
|
|
|
|
# Exposed Data
|
|
|
|
pushSheet: (sheet) ->
|
|
@_stack.push(sheet)
|
|
@trigger()
|
|
|
|
popSheet: ->
|
|
@_stack.pop()
|
|
@trigger()
|
|
|
|
topSheet: ->
|
|
@_stack[@_stack.length - 1]
|
|
|
|
stack: ->
|
|
@_stack
|
|
|
|
module.exports = SheetStore
|