Skip to content

Commit

Permalink
Merge pull request #1715 from Princeton-CDH/bugfix/1698-alignment-rev…
Browse files Browse the repository at this point in the history
…isions

Improve alignment behavior in editor (#1698)
  • Loading branch information
blms authored Jan 9, 2025
2 parents 9ed7b1b + 50ab824 commit d15759c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions sitemedia/js/controllers/ittpanel_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export default class extends Controller {
}
// on resize, retrigger alignment
window.addEventListener("resize", this.boundResizeHandler);
// a bit hacky; on annotation load, short wait for elements to be created, then align
// (this is only used in editor environment)
document.addEventListener("annotations-loaded", () =>
setTimeout(this.boundResizeHandler, 50)
);
}

disconnect() {
Expand Down
4 changes: 2 additions & 2 deletions sitemedia/scss/components/_transcription.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1468,13 +1468,13 @@

&[dir="ltr"] {
li {
margin-left: 1.5em;
margin-left: 1.6em;
padding-left: 1em; /* shift to make space for line numbers */
}
p {
// match alignment of list items
margin-left: 1em;
padding-left: 1.5em;
padding-left: 1.6em;
}
li > p {
// if inside a list item, don't pad <p>
Expand Down

0 comments on commit d15759c

Please sign in to comment.