Sha256: 88b8678716569fb134f35f61e67ed64bb4174c9bccac2fd622afa186c58b7581
Contents?: true
Size: 1.1 KB
Versions: 16
Compression:
Stored size: 1.1 KB
Contents
module Headmin module Form class RedactorxView < ViewModel def options default_options.deep_merge(to_h) end private def default_options { data: { controller: "redactorx", "redactor-options": redactor_options } } end def control @control || (hybrid ? true : nil) end def context @context || (hybrid ? true : nil) end def toolbar @toolbar || (hybrid ? false : nil) end def addbar @addbar || %w[paragraph image embed table quote pre line] end def plugins @plugins || %w[shortcut] end attr_reader :topbar def redactor_options default_redactor_options.deep_merge(redactor || {}) end def default_redactor_options { control: control, context: context, toolbar: toolbar, buttons: { addbar: addbar, plugins: plugins, topbar: topbar } }.delete_if { |k, v| v.nil? } end end end end
Version data entries
16 entries across 16 versions & 1 rubygems