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.47 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.46 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.45 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.44 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.43 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.42 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.41 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.40 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.39 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.38 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.37 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.36 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.35 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.34 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.33 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.32 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.31 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.30 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.29 app/models/effective/form_inputs/password_field.rb
effective_bootstrap-0.9.28 app/models/effective/form_inputs/password_field.rb