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.6.5 lib/volt/models/persistors/params.rb
volt-0.6.4 lib/volt/models/persistors/params.rb
volt-0.6.3 lib/volt/models/persistors/params.rb
volt-0.6.2 lib/volt/models/persistors/params.rb
volt-0.6.1 lib/volt/models/persistors/params.rb
volt-0.6.0 lib/volt/models/persistors/params.rb
volt-0.5.18 lib/volt/models/persistors/params.rb
volt-0.5.17 lib/volt/models/persistors/params.rb
volt-0.5.16 lib/volt/models/persistors/params.rb
volt-0.5.15 lib/volt/models/persistors/params.rb
volt-0.5.14 lib/volt/models/persistors/params.rb
volt-0.5.13 lib/volt/models/persistors/params.rb
volt-0.5.12 lib/volt/models/persistors/params.rb
volt-0.5.11 lib/volt/models/persistors/params.rb
volt-0.5.10 lib/volt/models/persistors/params.rb
volt-0.5.9 lib/volt/models/persistors/params.rb
volt-0.5.8 lib/volt/models/persistors/params.rb
volt-0.5.7 lib/volt/models/persistors/params.rb
volt-0.5.6 lib/volt/models/persistors/params.rb
volt-0.5.4 lib/volt/models/persistors/params.rb