Bug 29937

Summary: class close, close the full windows
Product: Koha Reporter: Hugo Agud <hagud>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Hugo Agud 2022-01-25 11:03:18 UTC
Good morning we have found something it could be an issue or not.. ;)

https://github.com/Koha-Community/Koha/blob/master/koha-tmpl/opac-tmpl/bootstrap/js/script.js#L40

$(document).ready(function(){
    $(".close").click(function(){
        window.close();
    });

the issue is basically that we assign a class $('.close') to do window.close()


We do have that handler bound to the class close, which can be considered a bit loose in scope and lead to clashes.

We have added a js on mainuserblock with .close, and when it clicks, close the full browser tab ;), of course we can change the class, but I think it is something to consider if change that code ;)

cheers
Comment 1 Katrin Fischer 2023-06-25 11:29:39 UTC
I believe this is a non-issue. The close is speaking and we also have required and hint as classes. When adding your own code, maybe adding a prefix for your library/installation could be a good habit to avoid unwanted clashes.