Sha256: a5ac76951eb4c866d0e2e6b919cf5d4363347dd453ba106270edd55e61a275bc

Contents?: true

Size: 603 Bytes

Versions: 6

Compression:

Stored size: 603 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
      if Volt.client?
        $page.url.update!
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
volt-0.8.14 lib/volt/models/persistors/params.rb
volt-0.8.13 lib/volt/models/persistors/params.rb
volt-0.8.11 lib/volt/models/persistors/params.rb
volt-0.8.10 lib/volt/models/persistors/params.rb
volt-0.8.9 lib/volt/models/persistors/params.rb
volt-0.8.8 lib/volt/models/persistors/params.rb