blacklight-frontend 7.21.2 → 7.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -366,7 +366,7 @@ Blacklight.modal.onFailure = function (jqXHR, textStatus, errorThrown) {
366
366
  console.error('Server error:', this.url, jqXHR.status, errorThrown);
367
367
  var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">&times;</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>';
368
368
  $(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
369
- $(Blacklight.modal.modalSelector).modal('show');
369
+ Blacklight.modal.show();
370
370
  };
371
371
 
372
372
  Blacklight.modal.receiveAjax = function (contents) {
@@ -385,7 +385,7 @@ Blacklight.modal.receiveAjax = function (contents) {
385
385
  $(Blacklight.modal.modalSelector).trigger(e); // if they did preventDefault, don't show the dialog
386
386
 
387
387
  if (e.isDefaultPrevented()) return;
388
- $(Blacklight.modal.modalSelector).modal('show');
388
+ Blacklight.modal.show();
389
389
  };
390
390
 
391
391
  Blacklight.modal.modalAjaxLinkClick = function (e) {
@@ -432,7 +432,7 @@ Blacklight.modal.setupModal = function () {
432
432
  Blacklight.modal.checkCloseModal = function (event) {
433
433
  if ($(event.target).find(Blacklight.modal.modalCloseSelector).length) {
434
434
  var modalFlashes = $(this).find('.flash_messages');
435
- $(event.target).modal('hide');
435
+ Blacklight.modal.hide(event.target);
436
436
  event.preventDefault();
437
437
  var mainFlashes = $('#main-flashes');
438
438
  mainFlashes.append(modalFlashes);
@@ -440,6 +440,22 @@ Blacklight.modal.checkCloseModal = function (event) {
440
440
  }
441
441
  };
442
442
 
443
+ Blacklight.modal.hide = function (el) {
444
+ if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal !== 'undefined' && bootstrap.Modal.VERSION >= "5") {
445
+ bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).hide();
446
+ } else {
447
+ $(el || Blacklight.modal.modalSelector).modal('hide');
448
+ }
449
+ };
450
+
451
+ Blacklight.modal.show = function (el) {
452
+ if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal !== 'undefined' && bootstrap.Modal.VERSION >= "5") {
453
+ bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).show();
454
+ } else {
455
+ $(el || Blacklight.modal.modalSelector).modal('show');
456
+ }
457
+ };
458
+
443
459
  Blacklight.onLoad(function () {
444
460
  Blacklight.modal.setupModal();
445
461
  });
@@ -1,6 +1,8 @@
1
1
  .constraints-container {
2
2
  @extend .mb-2;
3
3
  display: flex;
4
+ flex-wrap: wrap;
5
+ gap: 0.5rem 0.25rem;
4
6
  }
5
7
 
6
8
  .applied-filter {
@@ -10,6 +12,7 @@
10
12
  cursor: default;
11
13
  text-overflow: ellipsis;
12
14
  overflow: hidden;
15
+ white-space: nowrap;
13
16
 
14
17
  @media (max-width: breakpoint-min(sm)) {
15
18
  max-width: breakpoint-min(sm) * .5;
@@ -62,6 +62,12 @@
62
62
 
63
63
  .card-header {
64
64
  @extend .bg-success;
65
+
66
+ .btn {
67
+ @if function-exists(color-contrast) {
68
+ color: color-contrast($success);
69
+ }
70
+ }
65
71
  }
66
72
  }
67
73
 
@@ -114,7 +114,7 @@ Blacklight.modal.onFailure = function(jqXHR, textStatus, errorThrown) {
114
114
  this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown +
115
115
  '</pre></div>';
116
116
  $(Blacklight.modal.modalSelector).find('.modal-content').html(contents);
117
- $(Blacklight.modal.modalSelector).modal('show');
117
+ Blacklight.modal.show();
118
118
  }
119
119
 
120
120
  Blacklight.modal.receiveAjax = function (contents) {
@@ -135,7 +135,7 @@ Blacklight.modal.receiveAjax = function (contents) {
135
135
  // if they did preventDefault, don't show the dialog
136
136
  if (e.isDefaultPrevented()) return;
137
137
 
138
- $(Blacklight.modal.modalSelector).modal('show');
138
+ Blacklight.modal.show();
139
139
  };
140
140
 
141
141
 
@@ -196,7 +196,7 @@ Blacklight.modal.checkCloseModal = function(event) {
196
196
  if ($(event.target).find(Blacklight.modal.modalCloseSelector).length) {
197
197
  var modalFlashes = $(this).find('.flash_messages');
198
198
 
199
- $(event.target).modal('hide');
199
+ Blacklight.modal.hide(event.target);
200
200
  event.preventDefault();
201
201
 
202
202
  var mainFlashes = $('#main-flashes');
@@ -205,6 +205,22 @@ Blacklight.modal.checkCloseModal = function(event) {
205
205
  }
206
206
  }
207
207
 
208
+ Blacklight.modal.hide = function(el) {
209
+ if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal !== 'undefined' && bootstrap.Modal.VERSION >= "5") {
210
+ bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).hide();
211
+ } else {
212
+ $(el || Blacklight.modal.modalSelector).modal('hide');
213
+ }
214
+ }
215
+
216
+ Blacklight.modal.show = function(el) {
217
+ if (typeof bootstrap !== 'undefined' && typeof bootstrap.Modal !== 'undefined' && bootstrap.Modal.VERSION >= "5") {
218
+ bootstrap.Modal.getOrCreateInstance(el || document.querySelector(Blacklight.modal.modalSelector)).show();
219
+ } else {
220
+ $(el || Blacklight.modal.modalSelector).modal('show');
221
+ }
222
+ }
223
+
208
224
  Blacklight.onLoad(function() {
209
225
  Blacklight.modal.setupModal();
210
226
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-frontend",
3
- "version": "7.21.2",
3
+ "version": "7.25.0",
4
4
  "description": "[![Build Status](https://travis-ci.com/projectblacklight/blacklight.png?branch=main)](https://travis-ci.com/projectblacklight/blacklight) [![Gem Version](https://badge.fury.io/rb/blacklight.png)](http://badge.fury.io/rb/blacklight) [![Coverage Status](https://coveralls.io/repos/github/projectblacklight/blacklight/badge.svg?branch=main)](https://coveralls.io/github/projectblacklight/blacklight?branch=main)",
5
5
  "main": "app/assets/javascripts/blacklight",
6
6
  "scripts": {