Skip to content

Commit

Permalink
XWIKI-22581: FocusCatcher input has no label
Browse files Browse the repository at this point in the history
* Comment formatting

Co-authored-by: Marius Dumitru Florea <marius@xwiki.com>
  • Loading branch information
Sereza7 and mflorea authored Dec 10, 2024
1 parent 471d225 commit c68e047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
max-height: 100%;
}

/* Transparent buttons that should fill the space they've been given on the grid*/
/* Transparent buttons that should fill the space they've been given on the grid */
.xGallery .previous, .xGallery .next,
.xGallery .maximize, .xGallery .minimize {
background-color: transparent;
Expand Down Expand Up @@ -89,12 +89,12 @@
opacity: 1;
}

/* Elements on the left of the grid are left aligned*/
/* Elements on the left of the grid are left aligned */
.xGallery .index, .xGallery .previous {
text-align: start;
}

/* Elements on the right of the grid are right aligned*/
/* Elements on the right of the grid are right aligned */
.xGallery .maximize, .xGallery .minimize, .xGallery .next {
text-align: end;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ XWiki.Gallery = Class.create({
);
this.container.addClassName('xGallery');

/* Instead of an arbitrary element to catch focus, we use the index.
* This index already stores the current image state, might as well be responsible for providing quick controls and
* explanations about these quick controls.
* Note that wrapping the image in an interactive container to handle this would have been a good solution too.
* However, this wrapping caused the image to overflow the CSS grid vertically when in maximized mode.
* Technically I couldn't find a CSS solution to prevent this, so I decided to make do without wrapping. */
// Instead of an arbitrary element to catch focus, we use the index.
// This index already stores the current image state, might as well be responsible for providing quick controls and
// explanations about these quick controls.
// Note that wrapping the image in an interactive container to handle this would have been a good solution too.
// However, this wrapping caused the image to overflow the CSS grid vertically when in maximized mode.
// Technically I couldn't find a CSS solution to prevent this, so I decided to make do without wrapping.
this.focusCatcher = this.container.down('.index');
this.focusCatcher.observe('keydown', this._onKeyDown.bindAsEventListener(this));

Expand Down

0 comments on commit c68e047

Please sign in to comment.