class Lebowski::Foundation::Views::Support::SegmentItem

Public Instance Methods

deselect() click to toggle source
# File lib/lebowski/foundation/views/segmented.rb, line 42
def deselect()
  view = @parent.segmented_view
  allow_empty = view.allowed_empty_selection?
  allow_multiple = view.allowed_multiple_selection?
  if allow_empty and allow_multiple
    click if selected?
  elsif allow_empty
    click if selected?
  elsif allow_multiple
    click if (selected? and @parent.selected_count > 1)
  end
end