module NfgUi::Components::Utilities::DisableWithable

Allows components to be setup to utilize disable_with

Public Instance Methods

data() click to toggle source
Calls superclass method
# File lib/nfg_ui/components/utilities/disable_withable.rb, line 6
def data
  disable_with ? super.merge!(disable_with: disable_with) : super
end
disable_with() click to toggle source
# File lib/nfg_ui/components/utilities/disable_withable.rb, line 10
def disable_with
  options.fetch(:disable_with, nil)
end

Private Instance Methods

default_disable_with() click to toggle source
# File lib/nfg_ui/components/utilities/disable_withable.rb, line 16
def default_disable_with
  @default_disable_with ||= view_context.ui.nfg(:icon, :loader, text: 'Saving')
end
non_html_attribute_options() click to toggle source
Calls superclass method
# File lib/nfg_ui/components/utilities/disable_withable.rb, line 20
def non_html_attribute_options
  super.push(:disable_with)
end