Sha256: 7416e2966082cb674dd834c9d2905853c190f8c9ca5867e29b866eb5d2e87dfa

Contents?: true

Size: 411 Bytes

Versions: 4

Compression:

Stored size: 411 Bytes

Contents

module Formstrap
  class WysiwygView < ViewModel
    def options
      default_options.deep_merge(to_h)
    end

    private

    def toolbar
      @toolbar != false
    end

    def default_options
      options = {
        redactor: {
          context: !toolbar,
          extrabar: toolbar,
        }
      }

      options[:redactor][:toolbar] = false if @toolbar == false

      options
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
formstrap-0.4.5 app/models/formstrap/wysiwyg_view.rb
formstrap-0.4.4 app/models/formstrap/wysiwyg_view.rb
formstrap-0.4.3 app/models/formstrap/wysiwyg_view.rb
formstrap-0.4.2 app/models/formstrap/wysiwyg_view.rb