Skip to content

Commit

Permalink
🐛 refresh CodeMirror editor when CSS tab is shown
Browse files Browse the repository at this point in the history
The CodeMirror editor was invisible until text was selected.  Added tab
show event handler to properly refresh the editor when the CSS tab
becomes visible.
  • Loading branch information
kirkkwang committed Jan 22, 2025
1 parent 984c237 commit acaaf6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/views/hyrax/admin/appearances/_custom_css_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
theme: 'base16-light',
autoRefresh: true
});

// refresh the editor when the tab is shown
jQuery('[href="#css"]').on('shown.bs.tab', function() {
editor.refresh();
});
</script>
</div>
<div class="card-footer">
Expand Down

0 comments on commit acaaf6a

Please sign in to comment.