Sha256: 5bbafe2a5a515a1b5c5637fc9c55d4771a4abdb062a9f52313fe90d6d45b0c08

Contents?: true

Size: 431 Bytes

Versions: 4

Compression:

Stored size: 431 Bytes

Contents

class Trix.ElementStore
  constructor: (elements) ->
    @reset(elements)

  add: (element) ->
    key = getKey(element)
    @elements[key] = element

  remove: (element) ->
    key = getKey(element)
    if value = @elements[key]
      delete @elements[key]
      value

  reset: (elements = []) ->
    @elements = {}
    @add(element) for element in elements
    elements

  getKey = (element) ->
    element.dataset.trixStoreKey

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/vendor/trix/src/trix/core/collections/element_store.coffee
vapid-0.1.2 lib/vapid/vendor/trix/src/trix/core/collections/element_store.coffee
vapid-0.1.1 lib/vapid/vendor/trix/src/trix/core/collections/element_store.coffee
vapid-0.1.0 lib/vapid/vendor/trix/src/trix/core/collections/element_store.coffee