Skip to content

Commit

Permalink
add flip indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettMCW committed Oct 3, 2024
1 parent 0637869 commit 71d3fde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/viewers/viewer/controls/Mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Mirror extends Control {
const title = `Flip ${flip_vertical ? 'vertical' : 'horizontal'}`;
const element = document.createElement('button');
element.className = this.class_name_ + (flip_vertical ? '-vertical glyphicon-resize-vertical' : '-horizontal glyphicon-resize-horizontal') +
' btn btn-default glyphicon ol-flip-button';
' btn btn-default btn-primary glyphicon ol-flip-button';
element.setAttribute('type', 'button');
element.title = title;

Expand Down Expand Up @@ -144,7 +144,10 @@ export class Mirror extends Control {
*/
handleClick_(event) {
event.preventDefault();
const axis = event.target.className.includes('ol-flip-vertical') ? 0 : 1;
let classname = event.target.className
const axis = classname.includes('ol-flip-vertical') ? 0 : 1;
classname = classname.includes('active') ? classname.replace(' active', '') : classname += ' active'
event.target.className = classname
this.flip(axis);
return true;
}
Expand Down

0 comments on commit 71d3fde

Please sign in to comment.