Skip to content

Commit

Permalink
Merge pull request #4050 from benwbrum/3002-freeze-table-header-update
Browse files Browse the repository at this point in the history
Mostly fixes regression caused by #4037; removes js error
  • Loading branch information
benwbrum authored Apr 23, 2024
2 parents 56db10a + 3c01fd1 commit f1b8a7f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/views/transcribe/display_page.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
=f.text_field :title
-if !@collection.field_based
=f.text_area(:source_text, class: 'page-editarea_textarea', autocomplete: "off", autocorrect: "off", autocapitalize: "off", spellcheck: @collection.enable_spellcheck, 'aria-label': t('.edit_transcription'))
-text_direction = Rtl.rtl?(@collection.text_language) ? 'rtl' : 'ltr'
=render({ :partial => '/shared/codemirror', :locals => { :textarea => "page_source_text", :text_direction => text_direction} })
-else
=render ({partial: 'transcription_field/field_layout', locals: {collection_id: @collection, transcribe: true}})

Expand All @@ -101,8 +103,6 @@ h2.legend =t('.notes_and_questions')
.page-notes
=render :partial => "notes/notes"

-text_direction = Rtl.rtl?(@collection.text_language) ? 'rtl' : 'ltr'
=render({ :partial => '/shared/codemirror', :locals => { :textarea => "page_source_text", :text_direction => text_direction} })

#custom-alert
#custom-alert-box
Expand Down Expand Up @@ -157,6 +157,16 @@ h2.legend =t('.notes_and_questions')
$('[data-layout-set]').on('click', function() {
var mode = $(this).data('layout-set');
Cookies.set('transcribe_layout_mode', mode, { expires: 365 });
window.removeEventListener('scroll', freezeTableColumn);
window.addEventListener('scroll', function (e) {
if(mode === 'ttb') {
freezeTableColumn('.page-imagescan', '.spreadsheet', '.ht_clone_top');
} else {
freezeTableColumn('.page-toolbar', '.spreadsheet', '.ht_clone_top');
}
});
$('[data-layout-mode]').attr('data-layout-mode', mode);
if (typeof viewer !== 'undefined') {
Expand Down

0 comments on commit f1b8a7f

Please sign in to comment.