Module: Playbook::Cursor

Included in:
KitBase
Defined in:
lib/playbook/cursor.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/playbook/cursor.rb', line 5

def self.included(base)
  base.prop :cursor
end

Instance Method Details

#cursor_optionsObject



19
20
21
22
23
# File 'lib/playbook/cursor.rb', line 19

def cursor_options
  {
    cursor: "cursor",
  }
end

#cursor_propsObject



9
10
11
12
13
14
15
16
17
# File 'lib/playbook/cursor.rb', line 9

def cursor_props
  selected_props = cursor_options.keys.select { |sk| try(sk) }
  return nil unless selected_props.present?

  selected_props.map do |k|
    cursor_value = send(k)
    "cursor_#{cursor_value.underscore}" if cursor_values.include? cursor_value
  end.compact.join(" ")
end

#cursor_valuesObject



25
26
27
# File 'lib/playbook/cursor.rb', line 25

def cursor_values
  %w[auto default none contextMenu help pointer progress wait cell crosshair text verticalText alias copy move noDrop notAllowed grab grabbing eResize nResize neResize nwResize sResize seResize swResize wResize ewResize nsResize neswResize nwseResize colResize rowResize allScroll zoomIn zoomOut]
end