From 89809aed5fdcd953d13b9108290c942a5182ceb4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 30 Jun 2022 15:37:55 +0200 Subject: [PATCH] Add counter on note input --- app/views/spree/admin/orders/_note.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/spree/admin/orders/_note.html.haml b/app/views/spree/admin/orders/_note.html.haml index b07d73978e..d5b2df2d38 100644 --- a/app/views/spree/admin/orders/_note.html.haml +++ b/app/views/spree/admin/orders/_note.html.haml @@ -1,9 +1,10 @@ %table.index.edit-note-table %tr.edit-note.hidden.total - %td{ :colspan => "5" } + %td{ colspan: "5", data: { controller: "input-char-count" }, style: "position: relative;" } %label = t(".note_label") - = text_field_tag :note, @order.note + = text_field_tag :note, @order.note, { maxLength: 280, data: { "input-char-count-target": "input" } } + %span.edit-note-count{ data: { "input-char-count-target": "count" }, style: "position: absolute; right: 7px; top: 7px; font-size: 11px;" } %td.actions = link_to '', '', class: 'save-note icon_link icon-ok no-text with-tip', data: { action: 'save' }, title: I18n.t('actions.save')