diff --git a/web_external/Datasets/ApplyMetadataView.js b/web_external/Datasets/ApplyMetadataView.js index 994483cd..c32109ff 100644 --- a/web_external/Datasets/ApplyMetadataView.js +++ b/web_external/Datasets/ApplyMetadataView.js @@ -1,5 +1,4 @@ import Backbone from 'backbone'; -import $ from 'jquery'; import _ from 'underscore'; import {SORT_DESC} from 'girder/constants'; @@ -148,16 +147,7 @@ const ApplyMetadataView = View.extend({ escapedHtml: true, yesText: 'Save', yesClass: 'btn-primary', - confirmCallback: () => { - // Ensure dialog is hidden before continuing. Otherwise, - // when validateMetadata() displays its modal alert dialog, - // the Bootstrap-created element with class "modal-backdrop" - // is erroneously not removed. - $('#g-dialog-container').on('hidden.bs.modal', () => { - let save = true; - this.validateMetadata(save); - }); - } + confirmCallback: _.bind(this.validateMetadata, this, true) }); } }, diff --git a/web_external/Featuresets/FeaturesetView.js b/web_external/Featuresets/FeaturesetView.js index 32a3b168..a02c321f 100644 --- a/web_external/Featuresets/FeaturesetView.js +++ b/web_external/Featuresets/FeaturesetView.js @@ -1,4 +1,3 @@ -import $ from 'jquery'; import _ from 'underscore'; import LoadingAnimation from 'girder/views/widgets/LoadingAnimation'; @@ -49,13 +48,7 @@ const FeaturesetView = View.extend({ confirm({ text: `

Permanently delete "${_.escape(this.model.name())}" featureset?

`, escapedHtml: true, - confirmCallback: () => { - // Ensure dialog is hidden before continuing. Otherwise, - // when destroy() displays its modal alert dialog, - // the Bootstrap-created element with class "modal-backdrop" - // is erroneously not removed. - $('#g-dialog-container').on('hidden.bs.modal', _.bind(this.destroyModel, this)); - } + confirmCallback: _.bind(this.destroyModel, this) }); }, diff --git a/web_external/Studies/StudyView.js b/web_external/Studies/StudyView.js index 0c7e04db..55961ede 100644 --- a/web_external/Studies/StudyView.js +++ b/web_external/Studies/StudyView.js @@ -80,13 +80,7 @@ const StudyView = View.extend({ confirm({ text: `

Permanently remove "${_.escape(user.name())}" from study?

`, escapedHtml: true, - confirmCallback: () => { - // Ensure dialog is hidden before continuing. Otherwise, - // when destroy() displays its modal alert dialog, - // the Bootstrap-created element with class "modal-backdrop" - // is erroneously not removed. - $('#g-dialog-container').on('hidden.bs.modal', _.bind(this.removeUser, this, user)); - } + confirmCallback: _.bind(this.removeUser, this, user) }); }, @@ -117,13 +111,7 @@ const StudyView = View.extend({ confirm({ text: `

Permanently delete "${_.escape(this.model.name())}" study?

`, escapedHtml: true, - confirmCallback: () => { - // Ensure dialog is hidden before continuing. Otherwise, - // when destroy() displays its modal alert dialog, - // the Bootstrap-created element with class "modal-backdrop" - // is erroneously not removed. - $('#g-dialog-container').on('hidden.bs.modal', _.bind(this.destroyModel, this)); - } + confirmCallback: _.bind(this.destroyModel, this) }); },