Skip to content
Snippets Groups Projects
Commit 78205f99 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Fix issues with Internet Explorer.

- Use jQuery to handle data attributes (needed for IE 9/10).
- Fix issue with all IE versions where Recaptcha dialogs don't accept any button presses.
parent 4b28c78e
No related merge requests found
...@@ -166,7 +166,7 @@ function recaptchaOnLoad() { ...@@ -166,7 +166,7 @@ function recaptchaOnLoad() {
if (typeof grecaptcha !== 'undefined') { if (typeof grecaptcha !== 'undefined') {
var captchas = $('.g-recaptcha:empty'); var captchas = $('.g-recaptcha:empty');
for (var i = 0; i < captchas.length; i++) { for (var i = 0; i < captchas.length; i++) {
captchas[i].dataset.captchaId = grecaptcha.render(captchas[i], captchas[i].dataset); $(captchas[i]).data('captchaId', grecaptcha.render(captchas[i], $(captchas[i]).data()));
} }
} }
} }
...@@ -321,6 +321,16 @@ function setupFacets() { ...@@ -321,6 +321,16 @@ function setupFacets() {
$('.facet.list-group .collapse').on('hidden.bs.collapse', facetSessionStorage); $('.facet.list-group .collapse').on('hidden.bs.collapse', facetSessionStorage);
} }
function setupIeSupport() {
// Disable Bootstrap modal focus enforce on IE since it breaks Recaptcha.
// Cannot use conditional comments since IE 11 doesn't support them but still has
// the issue
var ua = window.navigator.userAgent;
if (ua.indexOf('MSIE') || ua.indexOf('Trident/')) {
$.fn.modal.Constructor.prototype.enforceFocus = function emptyEnforceFocus() { };
}
}
$(document).ready(function commonDocReady() { $(document).ready(function commonDocReady() {
// Start up all of our submodules // Start up all of our submodules
VuFind.init(); VuFind.init();
...@@ -382,4 +392,6 @@ $(document).ready(function commonDocReady() { ...@@ -382,4 +392,6 @@ $(document).ready(function commonDocReady() {
$('.searchFormKeepFilters').prop('checked', state); $('.searchFormKeepFilters').prop('checked', state);
$('.applied-filter').prop('checked', state); $('.applied-filter').prop('checked', state);
} }
setupIeSupport();
}); });
...@@ -104,7 +104,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() { ...@@ -104,7 +104,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() {
function lightboxFacetSorting() { function lightboxFacetSorting() {
var sortButtons = $('.js-facet-sort'); var sortButtons = $('.js-facet-sort');
function sortAjax(button) { function sortAjax(button) {
var sort = button.dataset.sort; var sort = $(button).data('sort');
var list = $('#facet-list-' + sort); var list = $('#facet-list-' + sort);
if (list.find('.js-facet-item').length === 0) { if (list.find('.js-facet-item').length === 0) {
list.find('.js-facet-next-page').text(VuFind.translate('loading') + '...'); list.find('.js-facet-next-page').text(VuFind.translate('loading') + '...');
...@@ -129,7 +129,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() { ...@@ -129,7 +129,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() {
lightboxFacetSorting(); lightboxFacetSorting();
$('.js-facet-next-page').click(function facetLightboxMore() { $('.js-facet-next-page').click(function facetLightboxMore() {
var button = $(this); var button = $(this);
var page = parseInt(this.dataset.page, 10); var page = parseInt(button.data('page'), 10);
if (button.attr('disabled')) { if (button.attr('disabled')) {
return false; return false;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment