Sha256: 9904e2ce2c0068baa9b86a14f7bc60a5fbb2f6645535f6ce4f63892731451d72

Contents?: true

Size: 581 Bytes

Versions: 9

Compression:

Stored size: 581 Bytes

Contents

require 'volt/models/persistors/base'

module Volt
  module Persistors
    class Params < Base
      def changed(attribute_name)
        if RUBY_PLATFORM == 'opal'
          `
            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.url.update! if Volt.client?
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
volt-0.9.4.pre3 lib/volt/models/persistors/params.rb
volt-0.9.4.pre2 lib/volt/models/persistors/params.rb
volt-0.9.4.pre1 lib/volt/models/persistors/params.rb
volt-0.9.3 lib/volt/models/persistors/params.rb
volt-0.9.3.pre6 lib/volt/models/persistors/params.rb
volt-0.9.3.pre5 lib/volt/models/persistors/params.rb
volt-0.9.3.pre4 lib/volt/models/persistors/params.rb
volt-0.9.3.pre3 lib/volt/models/persistors/params.rb
volt-0.9.3.pre2 lib/volt/models/persistors/params.rb