Sha256: 1dc840b098c0cd0d18b2d3643f8ac836d2bb73902b2f38873579233ff6af4c83

Contents?: true

Size: 682 Bytes

Versions: 8

Compression:

Stored size: 682 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
      # TODORW:
      # $page.params.trigger!('child_changed') if Volt.client?
      if Volt.client?
        $page.url.update!
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
volt-0.8.7 lib/volt/models/persistors/params.rb
volt-0.8.6 lib/volt/models/persistors/params.rb
volt-0.8.5 lib/volt/models/persistors/params.rb
volt-0.8.4 lib/volt/models/persistors/params.rb
volt-0.8.3 lib/volt/models/persistors/params.rb
volt-0.8.2 lib/volt/models/persistors/params.rb
volt-0.8.1 lib/volt/models/persistors/params.rb
volt-0.8.0 lib/volt/models/persistors/params.rb