Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add autofocus on item or element edit (for HumHub 1.17) #338

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

Unreleased
----------------------
- Fix: Add autofocus on item or element edit (for HumHub 1.17 - see https://github.com/humhub/humhub/issues/7136)

1.10.5 (July 15, 2024)
----------------------
- Enh #336: Renaming page and snippet to global and space types
Expand Down Expand Up @@ -192,8 +196,7 @@ Changelog

1.1.0 (November 3, 2020)
------------------------
The default folders for PHP custom pages were changed.
New defaults: php-pages/container_pages/, php-pages/container_snippets/, php-pages/global_pages/, php-pages/global_snippets/
The default folders for PHP custom pages were changed. New defaults: php-pages/container_pages/, php-pages/container_snippets/, php-pages/global_pages/, php-pages/global_snippets/

- Fix #121: Link color in markdown pages have same color as text
- Fix #143: (Global) PHP pages were lost on module updates
Expand Down
2 changes: 1 addition & 1 deletion modules/template/widgets/views/editElementModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>

<?php if($model->element->isNewRecord) : ?>
<?= $form->field($model->element, 'name')->textInput(); ?>
<?= $form->field($model->element, 'name')->textInput(['autofocus' => '']); ?>
<?php else: ?>
<div style="display:none">
<?= $form->field($model->element, 'name')->hiddenInput()->label(false); ?>
Expand Down
10 changes: 5 additions & 5 deletions modules/template/widgets/views/editItemModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

<?php humhub\widgets\ModalDialog::begin(['header' => $title, 'size' => 'large']) ?>
<?php $form = ActiveForm::begin(['action' => $action, 'enableClientValidation' => false]); ?>
<div class="modal-body media-body template-edit-multiple">
<?= $form->field($model, 'title')->textInput(['class' => 'form-control template-edit-multiple-title', 'placeholder' => Yii::t('CustomPagesModule.base', 'Item name')])->label(false); ?>
<div class="modal-body media-body template-edit-multiple">

<?= $form->field($model, 'title')->textInput(['class' => 'form-control template-edit-multiple-title', 'placeholder' => Yii::t('CustomPagesModule.base', 'Item name'), 'autofocus' => ''])->label(false); ?>

<?php $counter = 0 ?>
<?php foreach ($model->contentMap as $key => $contentItem) : ?>

Expand Down Expand Up @@ -68,4 +68,4 @@
<button type="button" class="btn btn-default" data-dismiss="modal"><?= Yii::t('CustomPagesModule.base', 'Cancel'); ?></button>
</div>
<?php ActiveForm::end(); ?>
<?php humhub\widgets\ModalDialog::end() ?>
<?php humhub\widgets\ModalDialog::end() ?>
Loading