Page 1 of 1

next / previous RTL direction - keyboard arrows !

Posted: 16 Sep 2022, 05:35
by sofian
hi
my site is
RTL direction
i converted the next / previous on the screen that the left is on right and the right is on left and it works ok .

But the next / previous keyboard arrows still works LTR .
how can i convert it with css or javascript code .
thanks.

Image

Re: next / previous RTL direction - keyboard arrows !

Posted: 16 Sep 2022, 16:50
by Jan
Hi, where exactly did you change it, for some specific Popup method?

Jan

Re: next / previous RTL direction - keyboard arrows !

Posted: 16 Sep 2022, 17:22
by sofian
Jan wrote: 16 Sep 2022, 16:50 Hi, where exactly did you change it, for some specific Popup method?

Jan
i added this css code to my custom css file :

Code: Select all

.pswp__button.pswp__button--arrow--right{left: 0;right: auto;}
.pswp__button.pswp__button--arrow--left{right: 0;left: auto;}
now i need same direction on keyboard left and right arrows .
Jan wrote: 16 Sep 2022, 16:50 for some specific Popup method?
i dont have any info about Popup method !
how many Popups has phoca gallery ? i dont know about this .

Re: next / previous RTL direction - keyboard arrows !

Posted: 16 Sep 2022, 18:30
by christine
Hi sofian,
sofian wrote: 16 Sep 2022, 17:22

i added this css code to my custom css file :

Code: Select all

.pswp__button.pswp__button--arrow--right{left: 0;right: auto;}
.pswp__button.pswp__button--arrow--left{right: 0;left: auto;}
It appears to be photoswipe.

i dont have any info about Popup method !
how many Popups has phoca gallery ? i dont know about this .
PG > Options > Detail View > Detail Window > there are 5 methods. (Joomla 4)

About the keyboards: I don't know

Kind regards
Christine

Re: next / previous RTL direction - keyboard arrows !

Posted: 16 Sep 2022, 18:54
by sofian
christine wrote: 16 Sep 2022, 18:30
It appears to be photoswipe.

PG > Options > Detail View > Detail Window > there are 5 methods. (Joomla 4)

About the keyboards: I don't know

Kind regards
Christine
yes it is photoswipe .
Image

Re: next / previous RTL direction - keyboard arrows !

Posted: 17 Sep 2022, 00:35
by sofian
this is the code that do the arrows slide :
media\com_phocagallery\js\photoswipe\js\photoswipe.min.js

Code: Select all

Xa=function(a){var b="";i.escKey&&27===a.keyCode?b="close":i.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next"))
i want to add this code to my custom js file :

Code: Select all

document.addEventListener('keydown', function(event) {
    if(event.keyCode == 37) {
       next image.....
    }
    else if(event.keyCode == 39) {
      prev image ..... 
    }
});
i just need to complete the final code .

Re: next / previous RTL direction - keyboard arrows !

Posted: 17 Sep 2022, 13:30
by Jan
Ok

Re: next / previous RTL direction - keyboard arrows !

Posted: 17 Sep 2022, 13:38
by sofian
Jan wrote: 17 Sep 2022, 13:30Ok
it not solved yet .
sofian wrote: 17 Sep 2022, 00:35 i just need to complete the final code .

Re: next / previous RTL direction - keyboard arrows !

Posted: 17 Sep 2022, 14:18
by Jan
Hi, OK (I understand), if you will solve it will be great to get updated solution here.
I think, the original version of the JS should be taken, not the minified and the changes should be done directly there :idea:
Jan