Sha256: 06e13d4ede853e12e81f3104886e764b2cd09fa639d3f19ff947e309cca48846

Contents?: true

Size: 1.32 KB

Versions: 7

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

# for browser rendering

module BrowserHelper

  # drag helper
  def self.browser_drag_move(params, atome_id, atome, proc)
    atome.drag_move_proc = proc
    atome_js.JS.drag(params, atome_id, atome)
  end

  # def self.browser_drag_end(params, atome_id, atome, proc)
  #   # alert :kool
  #   # atome.drag_move_proc = proc
  #   # atome_js.JS.drag(params, atome_id, atome)
  # end

  def self.browser_drag_lock(params, atome_id, atome, _proc)
    atome_js.JS.lock(params, atome_id, atome)
  end

  def self.browser_drag_remove(params, atome_id, atome, _proc)
    params = params != true
    atome_js.JS.remove(params, atome_id, atome)
  end

  def self.browser_drag_snap(params, atome_id, atome, _proc)
    atome_js.JS.snap(params.to_n, atome_id, atome)
  end

  def self.browser_drag_inertia(params, atome_id, atome, _proc)
    atome_js.JS.inertia(params, atome_id, atome)
  end

  def self.browser_drag_constraint(params, atome_id, atome, _proc)
    atome_js.JS.constraint(params.to_n, atome_id, atome)
  end

  def self.browser_drag_start(_params, _atome_id, atome, proc)
    atome.drag_start_proc = proc
  end

  def self.browser_drag_end(_params, _atome_id, atome, proc)
    atome.drag_end_proc = proc
  end

  def self.browser_drag_start(_params, _atome_id, atome, proc)
    atome.drag_start_proc = proc
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
atome-0.5.4.1.9 lib/atome/renderers/browser/helpers/drag_helper.rb
atome-0.5.4.1.7 lib/atome/renderers/browser/helpers/drag_helper.rb
atome-0.5.4.1.3 lib/atome/renderers/browser/helpers/drag_helper.rb
atome-0.5.4.1.2 lib/atome/renderers/browser/helpers/drag_helper.rb
atome-0.5.4.1.1 lib/atome/renderers/browser/helpers/drag_helper.rb
atome-0.5.4.1.0 lib/atome/renderers/browser/helpers/drag_helper.rb
atome-0.5.4.0.9 lib/atome/renderers/browser/helpers/drag_helper.rb