Sha256: db002ee80afe7496daec05d43a4a2de385686078a20857236c059bb32f4d7c97

Contents?: true

Size: 606 Bytes

Versions: 23

Compression:

Stored size: 606 Bytes

Contents

require 'volt/models/persistors/base'

module Persistors
  class Params < Base
    def initialize(model)
      @model = model
    end

    def changed(attribute_name)
      if RUBY_PLATFORM == 'opal'
        %x{
          if (window.setTimeout && this.$run_update.bind) {
            if (window.paramsUpdateTimer) {
              clearTimeout(window.paramsUpdateTimer);
            }
            window.paramsUpdateTimer = setTimeout(this.$run_update.bind(this), 0);
          }
        }
      end
    end

    def run_update
      $page.params.trigger!('child_changed') if Volt.client?
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
volt-0.7.23 lib/volt/models/persistors/params.rb
volt-0.7.22 lib/volt/models/persistors/params.rb
volt-0.7.21 lib/volt/models/persistors/params.rb
volt-0.7.20 lib/volt/models/persistors/params.rb
volt-0.7.19 lib/volt/models/persistors/params.rb
volt-0.7.18 lib/volt/models/persistors/params.rb
volt-0.7.17 lib/volt/models/persistors/params.rb
volt-0.7.16 lib/volt/models/persistors/params.rb
volt-0.7.15 lib/volt/models/persistors/params.rb
volt-0.7.14 lib/volt/models/persistors/params.rb
volt-0.7.13 lib/volt/models/persistors/params.rb
volt-0.7.12 lib/volt/models/persistors/params.rb
volt-0.7.10 lib/volt/models/persistors/params.rb
volt-0.7.9 lib/volt/models/persistors/params.rb
volt-0.7.8 lib/volt/models/persistors/params.rb
volt-0.7.7 lib/volt/models/persistors/params.rb
volt-0.7.6 lib/volt/models/persistors/params.rb
volt-0.7.5 lib/volt/models/persistors/params.rb
volt-0.7.4 lib/volt/models/persistors/params.rb
volt-0.7.3 lib/volt/models/persistors/params.rb