mirror of
https://github.com/humhub/humhub.git
synced 2025-04-20 07:02:13 +02:00
Enh: Added loader button to space/user settings
This commit is contained in:
parent
519a8e768e
commit
694e0f540b
@ -152,7 +152,6 @@ $(document).ready(function () {
|
||||
|
||||
initPlugins();
|
||||
|
||||
var x = 0;
|
||||
$('a[data-ui-loader], button[data-ui-loader]').on('click', function () {
|
||||
var $this = $(this);
|
||||
|
||||
@ -160,17 +159,19 @@ $(document).ready(function () {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Adopt current color for the loader animation
|
||||
var color = $this.css('color') || '#ffffff';
|
||||
var $loader = $('<span class="loader"><span class="sk-spinner sk-spinner-three-bounce"><span class="sk-bounce1"></span><span class="sk-bounce2"></span><span class="sk-bounce3"></span></span></span>');
|
||||
|
||||
//Align bouncer animation color and size
|
||||
$loader.find('.sk-bounce1, .sk-bounce2, .sk-bounce3')
|
||||
.addClass('disabled')
|
||||
.css( {'background-color': color, 'width': '10px', 'height': '10px'});
|
||||
|
||||
//The loader does have some margin we have to hide
|
||||
$this.css('overflow', 'hidden');
|
||||
$this.addClass('disabled');
|
||||
|
||||
|
||||
//Prevent the container from resizing
|
||||
$this.css('min-width', this.getBoundingClientRect().width);
|
||||
$this.data('text', $this.text());
|
||||
@ -182,7 +183,7 @@ $(document).ready(function () {
|
||||
$('[data-ui-loader]').each(function() {
|
||||
var $this = $(this);
|
||||
if($this.find('.loader').length) {
|
||||
$this.html($(this).data('text'));
|
||||
$this.html($this.data('text'));
|
||||
$this.removeClass('disabled');
|
||||
}
|
||||
});
|
||||
|
@ -162,7 +162,7 @@ class HForm extends \yii\base\Component
|
||||
$output = "";
|
||||
foreach ($buttons as $buttonName => $definition) {
|
||||
if ($definition['type'] == 'submit') {
|
||||
$output .= \yii\helpers\Html::submitButton($definition['label'], ['name' => $buttonName, 'class' => $definition['class']]);
|
||||
$output .= \yii\helpers\Html::submitButton($definition['label'], ['name' => $buttonName, 'class' => $definition['class'], 'data-ui-loader' => '']);
|
||||
$output .= " ";
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ $this->registerCssFile('@web/resources/space/colorpicker/css/bootstrap-colorpick
|
||||
</div>
|
||||
|
||||
|
||||
<?php echo Html::submitButton(Yii::t('SpaceModule.views_admin_edit', 'Save'), array('class' => 'btn btn-primary')); ?>
|
||||
<?php echo Html::submitButton(Yii::t('SpaceModule.views_admin_edit', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
|
||||
|
||||
<?php echo \humhub\widgets\DataSaved::widget(); ?>
|
||||
|
||||
|
@ -37,7 +37,7 @@ use humhub\modules\space\modules\manage\widgets\DefaultMenu;
|
||||
<?php echo $form->field($model, 'default_content_visibility')->dropdownList($contentVisibilities); ?>
|
||||
<p class="help-block"><?php echo Yii::t('SpaceModule.views_admin_edit', 'Choose if new content should be public or private by default'); ?></p>
|
||||
|
||||
<?php echo Html::submitButton(Yii::t('base', 'Save'), array('class' => 'btn btn-primary')); ?>
|
||||
<?php echo Html::submitButton(Yii::t('base', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
|
||||
|
||||
<?php echo \humhub\widgets\DataSaved::widget(); ?>
|
||||
|
||||
|
@ -22,7 +22,7 @@ use \humhub\compat\CHtml;
|
||||
<?php echo $form->field($model, 'newEmail')->textInput(['maxlength' => 45]); ?>
|
||||
|
||||
<hr>
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_changeEmail', 'Save'), array('class' => 'btn btn-primary')); ?>
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_changeEmail', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
|
||||
|
||||
<!-- show flash message after saving -->
|
||||
<?php echo \humhub\widgets\DataSaved::widget(); ?>
|
||||
|
@ -18,7 +18,7 @@ use humhub\compat\CHtml;
|
||||
<?php echo $form->field($model, 'newPasswordConfirm')->passwordInput(['maxlength' => 45]); ?>
|
||||
|
||||
<hr>
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_changePassword', 'Save'), array('class' => 'btn btn-primary')); ?>
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_changePassword', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
|
||||
|
||||
|
||||
<!-- show flash message after saving -->
|
||||
|
@ -43,7 +43,7 @@ use \humhub\models\Setting;
|
||||
<?php endif; ?>
|
||||
<hr>
|
||||
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_editSettings', 'Save'), array('class' => 'btn btn-primary')); ?>
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_editSettings', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
|
||||
|
||||
<!-- show flash message after saving -->
|
||||
<?php echo \humhub\widgets\DataSaved::widget(); ?>
|
||||
|
@ -46,7 +46,7 @@ use humhub\modules\user\models\User;
|
||||
|
||||
<hr>
|
||||
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_emailing', 'Save'), array('class' => 'btn btn-primary')); ?>
|
||||
<?php echo CHtml::submitButton(Yii::t('UserModule.views_account_emailing', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
|
||||
|
||||
<!-- show flash message after saving -->
|
||||
<?php echo \humhub\widgets\DataSaved::widget(); ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user