Sha256: 353a47a811ac2eb8afb52811d608f878cbbcb3b58954b3f9a401da4f4afab767

Contents?: true

Size: 613 Bytes

Versions: 31

Compression:

Stored size: 613 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

31 entries across 31 versions & 1 rubygems

Version Path
volt-0.5.3 lib/volt/models/persistors/params.rb
volt-0.5.2 lib/volt/models/persistors/params.rb
volt-0.5.1 lib/volt/models/persistors/params.rb
volt-0.5.0 lib/volt/models/persistors/params.rb
volt-0.4.18 lib/volt/models/persistors/params.rb
volt-0.4.17 lib/volt/models/persistors/params.rb
volt-0.4.15 lib/volt/models/persistors/params.rb
volt-0.4.14 lib/volt/models/persistors/params.rb
volt-0.4.12 lib/volt/models/persistors/params.rb
volt-0.4.11 lib/volt/models/persistors/params.rb
volt-0.4.10 lib/volt/models/persistors/params.rb