frayerjj-frontend 0.2.8 → 0.2.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/modal.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frayerjj-frontend",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "My base frontend for various projects",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/modal.js CHANGED
@@ -145,8 +145,8 @@ export const modal = {
145
145
  ajaxModal.addEventListener('hidden.bs.modal', ev => {
146
146
  ev.target.remove();
147
147
  });
148
- let bsAjaxModal = bootstrap.Modal.getOrCreateInstance(ajaxModal);
149
148
  let ajaxModalBody = ajaxModal.querySelector('.modal-body');
149
+ let bsAjaxModal = bootstrap.Modal.getOrCreateInstance(ajaxModal);
150
150
  bsAjaxModal.show();
151
151
  loading.start(ajaxModalBody);
152
152
  message.verbose('Loading AJAX Modal');
@@ -179,7 +179,7 @@ export const modal = {
179
179
  vars: serialize(form),
180
180
  success: () => {
181
181
  message.verbose('AJAX Modal Saved');
182
- bsAjaxModal.hide();
182
+ if (bsAjaxModal) bsAjaxModal.hide();
183
183
  ajaxModal.remove();
184
184
  loading.stop();
185
185
  },
@@ -195,7 +195,7 @@ export const modal = {
195
195
  failure: () => {
196
196
  message.warn('AJAX Modal Load Failed');
197
197
  loading.stop();
198
- bsAjaxModal.hide();
198
+ if (bsAjaxModal) bsAjaxModal.hide();
199
199
  ajaxModal.remove();
200
200
  modal.alert(modal.ajax.error.load.msg, modal.ajax.error.load.title);
201
201
  }