Use correct loading mode of Bootstrap-Markdown

data-provide="markdown-editable" is intended for inline editing of page
content à la contenteditable. When this is applied to a textarea, the
editor is loaded only after the user clicks on the field. This behavior
breaks focus and is incompatible with keyboard navigation.
This commit is contained in:
Andrew Kvalheim 2020-04-04 21:48:31 -07:00 committed by Henne Vogelsang
parent 0646e41a82
commit ce59c37ff6
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
15 changed files with 19 additions and 19 deletions

View file

@ -17,7 +17,7 @@
input_html: { class: 'form-control',
id: 'registration-period-end-datepicker' }
= f.input :description, hint: markdown_hint,
input_html: { rows: 2, data: { provide: 'markdown-editable' } }
input_html: { rows: 2, data: { provide: 'markdown' } }
- if cfp.cfp_type == 'events'
= f.input :enable_registrations, as: :boolean,
hint: 'Allow submitters to request registration?'

View file

@ -9,7 +9,7 @@
= semantic_form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f|
= f.input :title, hint: "The full title of the conference, e.g. 'openSUSE Conference 2014'"
= f.input :short_title, hint: "A short title, e.g. 'oSC14', to be used in URLs"
= f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :color, hint: 'The color will be used eg for the dashboard.', input_html: {size: 6, type: 'color'}
= f.label 'Conference Logo'
%br

View file

@ -11,7 +11,7 @@
= semantic_form_for(@lodging, url: (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f|
= f.input :name, input_html: { autofocus: true}
= f.input :website_link, input_html: { type: :url }
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint
- if @lodging.picture?
= image_tag @lodging.picture.thumb.url
= f.input :picture

View file

@ -2,11 +2,11 @@
= f.inputs name: 'Organization details' do
= f.input :name, as: :string, required: true
= f.input :description, as: :text,
input_html: { rows: 10, data: { provide: 'markdown-editable' } },
input_html: { rows: 10, data: { provide: 'markdown' } },
hint: markdown_hint,
placeholder: 'Decribe about your organization...'
= f.input :code_of_conduct, as: :text,
input_html: { rows: 10, data: { provide: 'markdown-editable' } },
input_html: { rows: 10, data: { provide: 'markdown' } },
hint: markdown_hint,
placeholder: 'Rules governing behavior and dispute resolution...'
= image_tag f.object.picture.thumb.url if f.object.picture?

View file

@ -9,7 +9,7 @@
.col-md-8
= semantic_form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f|
= f.input :name, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :used
= f.input :quantity
%p.text-right

View file

@ -10,7 +10,7 @@
.col-md-8
= semantic_form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f|
= f.input :name, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint
= image_tag f.object.picture.thumb.url if f.object.picture?
= f.input :picture
= f.input :website_url

View file

@ -10,7 +10,7 @@
.col-md-8
= semantic_form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f|
= f.input :title, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :price
= f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false
= f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.'

View file

@ -23,6 +23,6 @@
with
= link_to 'rooms', admin_conference_venue_rooms_path(@conference.short_title)
, if you want to select a room for the track.
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown' } }, hint: markdown_hint
= f.input :cfp_active, label: 'Allow event submitters to select this track for their proposal'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -20,7 +20,7 @@
= f.input :email
= f.input :password if @user.new_record?
= f.input :affiliation, as: :string
= f.input :biography, input_html: { rows: 10, data: { provide: 'markdown-editable' } },
= f.input :biography, input_html: { rows: 10, data: { provide: 'markdown' } },
hint: markdown_hint
= f.actions do
= f.action :submit, button_html: {class: 'btn btn-primary'}

View file

@ -14,7 +14,7 @@
.col-md-8
= semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f|
= f.inputs :name, :website
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint
= f.label 'Venue Logo'
%br
- if @venue.picture?