Close modal window on click link with url in href (#4812)

This commit is contained in:
Yuriy Bakhtin 2021-02-04 18:12:50 +03:00 committed by GitHub
parent 066252b8dc
commit 0874a48727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -8,6 +8,7 @@ HumHub Changelog
- Fix #4793: Form labels (HForm) are not displayed correctly
- Fix #4569: Prevent double module registration
- Fix #4389: Require to check a checkbox if the profile field is required
- Fix #2950: Close modal window on click link with url in href
- Fix #3687: Disable profile field type for existing record
- Fix #4819: Fixed some PHP8 issues. (Updated to Yii 2.0.40 / Imagine 1.0+)
- Fix #4825: Ensure unique setting values (Added unique table index)

View File

@ -696,6 +696,15 @@ humhub.module('ui.modal', function (module, require, $) {
});
};
var unload = function() {
$('.modal').each(function () {
var modal = Modal.instance(this);
if (modal && typeof modal.close === 'function') {
modal.close();
}
});
}
var post = function (evt, options) {
var id = evt.$trigger.data('modal-id');
if (!id) {
@ -756,6 +765,7 @@ humhub.module('ui.modal', function (module, require, $) {
get: get,
post: post,
load: load,
unload: unload,
show: show,
submit: submit
});