Skip to content

Commit

Permalink
OBPIH-6092 Experimental fix to the issue with jquery tabs loading (#4550
Browse files Browse the repository at this point in the history
)

* OBPIH-6092 Experimental fix to the issue with jquery tabs loading

* OBPIH-6092 Change var to let and const
  • Loading branch information
awalkowiak committed Mar 18, 2024
1 parent 720bc16 commit f30470e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion grails-app/views/layouts/custom.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<g:javascript library="application"/>

<!-- Include jQuery UI files -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.8.24/themes/smoothness/jquery-ui.min.css" type="text/css" media="all" />

Expand Down
4 changes: 2 additions & 2 deletions grails-app/views/layouts/stockCard.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
},
ajaxOptions: {
error: function(xhr, status, index, anchor) {
var errorMessage = "Error loading tab: " + xhr.status + " " + xhr.statusText;
let errorMessage = "Error loading tab: " + xhr.status + " " + xhr.statusText;
// Attempt to get more detailed error message
if (xhr.responseText) {
var json = JSON.parse(xhr.responseText);
const json = JSON.parse(xhr.responseText);
if (json.errorMessage) {
errorMessage = json.errorMessage
}
Expand Down
11 changes: 11 additions & 0 deletions grails-app/views/order/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,17 @@
},
ajaxOptions: {
error: function(xhr, status, index, anchor) {
let errorMessage = "Error loading tab: " + xhr.status + " " + xhr.statusText;
// Attempt to get more detailed error message
if (xhr.responseText) {
const json = JSON.parse(xhr.responseText);
if (json.errorMessage) {
errorMessage = json.errorMessage
}
}
// Display error message
$(anchor.hash).text(errorMessage);
// Reload the page if session has timed out
if (xhr.statusCode == 401) {
window.location.reload();
Expand Down

0 comments on commit f30470e

Please sign in to comment.