mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Merge branch 'master' into develop
This commit is contained in:
commit
17b1618603
@ -8,6 +8,8 @@ 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 #4281: Update space chooser after following a space
|
||||
- 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)
|
||||
|
@ -7,11 +7,17 @@
|
||||
humhub.module('content.container', function (module, require, $) {
|
||||
var client = require('client');
|
||||
var additions = require('ui.additions');
|
||||
var chooser = require('space.chooser');
|
||||
|
||||
var follow = function(evt) {
|
||||
var containerId = evt.$trigger.data('content-container-id');
|
||||
client.post(evt).then(function(response) {
|
||||
additions.switchButtons(evt.$trigger, $('[data-content-container-id="'+containerId+'"].unfollowButton'));
|
||||
if (response.success) {
|
||||
additions.switchButtons(evt.$trigger, $('[data-content-container-id="' + containerId + '"].unfollowButton'));
|
||||
if (response.space) {
|
||||
chooser.SpaceChooser.instance($('#space-menu-dropdown')).appendItem(response.space);
|
||||
}
|
||||
}
|
||||
}).catch(function(e) {
|
||||
module.log.error(e, true);
|
||||
});
|
||||
@ -20,7 +26,12 @@ humhub.module('content.container', function (module, require, $) {
|
||||
var unfollow = function(evt) {
|
||||
var containerId = evt.$trigger.data('content-container-id');
|
||||
client.post(evt).then(function(response) {
|
||||
additions.switchButtons(evt.$trigger, $('[data-content-container-id="'+containerId+'"].followButton'));
|
||||
if (response.success) {
|
||||
additions.switchButtons(evt.$trigger, $('[data-content-container-id="' + containerId + '"].followButton'));
|
||||
if (response.space) {
|
||||
chooser.SpaceChooser.instance($('#space-menu-dropdown')).removeItem(response.space);
|
||||
}
|
||||
}
|
||||
}).catch(function(e) {
|
||||
module.log.error(e, true);
|
||||
});
|
||||
|
@ -11,6 +11,7 @@ namespace humhub\modules\space\controllers;
|
||||
use humhub\modules\content\components\ContentContainerController;
|
||||
use humhub\components\behaviors\AccessControl;
|
||||
use humhub\modules\space\models\Space;
|
||||
use humhub\modules\space\widgets\Chooser;
|
||||
use humhub\modules\user\models\User;
|
||||
use humhub\modules\user\widgets\UserListBox;
|
||||
use humhub\modules\stream\actions\ContentContainerStream;
|
||||
@ -127,7 +128,10 @@ class SpaceController extends ContentContainerController
|
||||
}
|
||||
|
||||
if (Yii::$app->request->isAjax) {
|
||||
return $this->asJson(['success' => $success]);
|
||||
return $this->asJson([
|
||||
'success' => $success,
|
||||
'space' => Chooser::getSpaceResult($space, true, ['isFollowing' => true]),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->redirect($space->getUrl());
|
||||
@ -144,7 +148,10 @@ class SpaceController extends ContentContainerController
|
||||
$success = $space->unfollow();
|
||||
|
||||
if (Yii::$app->request->isAjax) {
|
||||
return $this->asJson(['success' => $success]);
|
||||
return $this->asJson([
|
||||
'success' => $success,
|
||||
'space' => $space->guid,
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->redirect($space->getUrl());
|
||||
|
@ -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
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user