Sha256: 6d5f8da9588b1f3814dac2f63fbb2eeb430e99d4b2468748ee0c1ba87ac0b55b

Contents?: true

Size: 944 Bytes

Versions: 29

Compression:

Stored size: 944 Bytes

Contents

module Effective
  module FormInputs
    class PasswordField < Effective::FormInput

      def input_html_options
        { class: 'form-control effective_password', id: tag_id }
      end

      def input_group_options
        { input_group: { class: 'input-group' }, append: eyes }
      end

      def eyes
        content_tag(:span, icon('eye'),
          class: 'btn input-group-text',
          title: 'Show password',
          'data-effective-password': 'text'
        ) +
        content_tag(:span, icon('eye-off'),
          class: 'btn input-group-text',
          title: 'Hide password',
          style: 'display: none;',
          'data-effective-password': 'password'
        )
      end

      def feedback_options
        case layout
        when :inline
          false
        else
          { valid: { class: 'valid-feedback' }, invalid: { class: 'invalid-feedback' }, reset: true }
        end
      end

    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
effective_bootstrap-0.9.27 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.26 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.25 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.24 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.23 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.22 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.21 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.20 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.19 app/models/effective/form_inputs/password_field.rb