511 lines
22 KiB
PHP
511 lines
22 KiB
PHP
<?php
|
|
|
|
use humhub\modules\animal_management\models\Animal;
|
|
use humhub\modules\animal_management\models\AnimalGalleryItem;
|
|
use humhub\modules\animal_management\models\AnimalProgressUpdate;
|
|
use humhub\modules\animal_management\models\forms\AnimalProgressUpdateForm;
|
|
use humhub\modules\space\models\Space;
|
|
use humhub\widgets\Button;
|
|
use yii\bootstrap\ActiveForm;
|
|
use yii\helpers\Html;
|
|
use yii\helpers\Json;
|
|
|
|
/* @var Space $space */
|
|
/* @var Animal $animal */
|
|
/* @var AnimalProgressUpdateForm $model */
|
|
/* @var AnimalProgressUpdate $progressUpdate */
|
|
/* @var string $returnTo */
|
|
/* @var AnimalGalleryItem[] $galleryItems */
|
|
/* @var bool $isInline */
|
|
|
|
$isInline = isset($isInline) ? (bool)$isInline : false;
|
|
$showTopCancel = (string)Yii::$app->request->get('showTopCancel', '0') === '1';
|
|
|
|
$renderCustomField = static function (string $fieldKey, AnimalProgressUpdateForm $formModel, array $definitions): string {
|
|
if (!isset($definitions[$fieldKey])) {
|
|
return '';
|
|
}
|
|
|
|
$definition = $definitions[$fieldKey];
|
|
$inputType = (string)$definition['input_type'];
|
|
$label = (string)$definition['label'];
|
|
if ((int)$definition['required'] === 1) {
|
|
$label .= ' *';
|
|
}
|
|
|
|
$fieldName = "AnimalProgressUpdateForm[customFields][$fieldKey]";
|
|
$fieldValue = $formModel->customFields[$fieldKey] ?? '';
|
|
|
|
ob_start();
|
|
?>
|
|
<?php if ($inputType === 'textarea'): ?>
|
|
<div class="form-group">
|
|
<label class="control-label" for="animalprogressupdateform-customfields-<?= Html::encode($fieldKey) ?>"><?= Html::encode($label) ?></label>
|
|
<?= Html::textarea($fieldName, (string)$fieldValue, ['class' => 'form-control', 'rows' => 3, 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
|
|
</div>
|
|
<?php elseif ($inputType === 'boolean'): ?>
|
|
<div class="checkbox" style="margin-bottom:10px;">
|
|
<label>
|
|
<?= Html::hiddenInput($fieldName, '0') ?>
|
|
<?= Html::checkbox($fieldName, !empty($fieldValue), ['value' => '1']) ?>
|
|
<?= Html::encode($label) ?>
|
|
</label>
|
|
</div>
|
|
<?php elseif ($inputType === 'select'): ?>
|
|
<div class="form-group">
|
|
<label class="control-label" for="animalprogressupdateform-customfields-<?= Html::encode($fieldKey) ?>"><?= Html::encode($label) ?></label>
|
|
<?= Html::dropDownList(
|
|
$fieldName,
|
|
(string)$fieldValue,
|
|
$formModel->getCustomFieldSelectOptions($fieldKey),
|
|
['class' => 'form-control', 'prompt' => Yii::t('AnimalManagementModule.base', 'Select...'), 'id' => "animalprogressupdateform-customfields-$fieldKey"]
|
|
) ?>
|
|
</div>
|
|
<?php elseif ($inputType === 'number'): ?>
|
|
<div class="form-group">
|
|
<label class="control-label" for="animalprogressupdateform-customfields-<?= Html::encode($fieldKey) ?>"><?= Html::encode($label) ?></label>
|
|
<?= Html::input('number', $fieldName, (string)$fieldValue, ['class' => 'form-control', 'step' => 'any', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
|
|
</div>
|
|
<?php elseif ($inputType === 'date'): ?>
|
|
<div class="form-group">
|
|
<label class="control-label" for="animalprogressupdateform-customfields-<?= Html::encode($fieldKey) ?>"><?= Html::encode($label) ?></label>
|
|
<?= Html::input('date', $fieldName, (string)$fieldValue, ['class' => 'form-control', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
|
|
</div>
|
|
<?php elseif ($inputType === 'datetime'): ?>
|
|
<div class="form-group">
|
|
<label class="control-label" for="animalprogressupdateform-customfields-<?= Html::encode($fieldKey) ?>"><?= Html::encode($label) ?></label>
|
|
<?= Html::input('datetime-local', $fieldName, (string)$fieldValue, ['class' => 'form-control', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="form-group">
|
|
<label class="control-label" for="animalprogressupdateform-customfields-<?= Html::encode($fieldKey) ?>"><?= Html::encode($label) ?></label>
|
|
<?= Html::textInput($fieldName, (string)$fieldValue, ['class' => 'form-control', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php
|
|
return (string)ob_get_clean();
|
|
};
|
|
|
|
$customDefinitions = $model->getCustomFieldDefinitions();
|
|
$knownProgressKeys = ['progress_notes', 'routine_updates', 'media_reference'];
|
|
$otherCustomDefinitions = [];
|
|
foreach ($customDefinitions as $fieldKey => $definition) {
|
|
if (in_array($fieldKey, $knownProgressKeys, true)) {
|
|
continue;
|
|
}
|
|
$otherCustomDefinitions[$fieldKey] = $definition;
|
|
}
|
|
|
|
$currentMediaReference = trim((string)($model->customFields['media_reference'] ?? ''));
|
|
$progressFormId = 'edit-progress-update-form';
|
|
|
|
$this->registerCss(<<<CSS
|
|
.inline-editor-shell.panel {
|
|
border: 1px solid rgba(255, 255, 255, 0.22);
|
|
border-radius: 12px;
|
|
background: rgba(10, 18, 28, 0.36);
|
|
}
|
|
|
|
.inline-editor-shell > .panel-heading {
|
|
color: #eef5fb;
|
|
background: rgba(10, 18, 28, 0.42);
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
.inline-editor-shell > .panel-body {
|
|
background: rgba(10, 18, 28, 0.2);
|
|
}
|
|
|
|
.inline-editor-shell .panel.panel-default {
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|
background: rgba(10, 18, 28, 0.34);
|
|
}
|
|
|
|
.inline-editor-shell .panel.panel-default > .panel-heading {
|
|
color: #eef5fb;
|
|
background: rgba(10, 18, 28, 0.42);
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
.inline-editor-shell .panel.panel-default > .panel-heading a {
|
|
color: inherit;
|
|
display: block;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.inline-editor-shell .panel.panel-default > .panel-heading a:hover,
|
|
.inline-editor-shell .panel.panel-default > .panel-heading a:focus {
|
|
color: #ffffff;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.inline-editor-shell,
|
|
.inline-editor-shell .panel-body,
|
|
.inline-editor-shell .control-label,
|
|
.inline-editor-shell .checkbox label,
|
|
.inline-editor-shell .radio label,
|
|
.inline-editor-shell .help-block {
|
|
color: #eef5fb;
|
|
}
|
|
|
|
.inline-editor-shell .text-muted {
|
|
color: rgba(233, 242, 250, 0.78) !important;
|
|
}
|
|
|
|
.inline-editor-shell .form-control {
|
|
background: rgba(10, 18, 28, 0.56);
|
|
border-color: rgba(255, 255, 255, 0.44);
|
|
color: #f3f8ff;
|
|
}
|
|
|
|
.inline-editor-shell .form-control::placeholder {
|
|
color: rgba(243, 248, 255, 0.72);
|
|
}
|
|
|
|
.inline-editor-shell .form-control[readonly],
|
|
.inline-editor-shell .form-control[disabled] {
|
|
background: rgba(10, 18, 28, 0.42);
|
|
color: rgba(243, 248, 255, 0.72);
|
|
}
|
|
|
|
.inline-editor-shell select.form-control option {
|
|
color: #0f1b2a;
|
|
}
|
|
|
|
.inline-editor-shell .animal-inline-top-save-action {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 26px;
|
|
height: 26px;
|
|
padding: 0;
|
|
border-radius: 999px;
|
|
border: 1px solid rgba(255, 255, 255, 0.36);
|
|
background: rgba(15, 23, 42, 0.72);
|
|
color: #f8fafc;
|
|
cursor: pointer;
|
|
line-height: 1;
|
|
font-size: 12px;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
|
|
}
|
|
|
|
.inline-editor-shell .animal-inline-top-save-action:hover,
|
|
.inline-editor-shell .animal-inline-top-save-action:focus {
|
|
background: rgba(30, 41, 59, 0.86);
|
|
border-color: rgba(255, 255, 255, 0.5);
|
|
color: #f8fafc;
|
|
outline: none;
|
|
}
|
|
CSS
|
|
);
|
|
|
|
if ($isInline) {
|
|
$this->registerCss(<<<CSS
|
|
html, body {
|
|
margin: 0 !important;
|
|
padding: 0 !important;
|
|
background: transparent !important;
|
|
scrollbar-width: none;
|
|
-ms-overflow-style: none;
|
|
}
|
|
|
|
html::-webkit-scrollbar, body::-webkit-scrollbar {
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
body > .panel:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
CSS
|
|
);
|
|
}
|
|
?>
|
|
|
|
<div class="panel panel-default inline-editor-shell">
|
|
<div class="panel-heading">
|
|
<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;">
|
|
<span><?= Yii::t('AnimalManagementModule.base', '<strong>Edit</strong> Progress Update') ?></span>
|
|
<?php if ($isInline): ?>
|
|
<span class="animal-inline-top-actions" style="display:inline-flex;gap:8px;margin-right:38px;">
|
|
<?= Html::submitButton('<i class="fa fa-check"></i>', [
|
|
'class' => 'animal-inline-top-save-action',
|
|
'title' => Yii::t('AnimalManagementModule.base', 'Save Progress Update'),
|
|
'form' => $progressFormId,
|
|
]) ?>
|
|
<?php if ($showTopCancel): ?>
|
|
<?= Html::button('<i class="fa fa-times"></i>', [
|
|
'id' => 'progress-inline-cancel-icon',
|
|
'class' => 'animal-inline-top-save-action',
|
|
'title' => Yii::t('AnimalManagementModule.base', 'Cancel'),
|
|
'type' => 'button',
|
|
]) ?>
|
|
<?php endif; ?>
|
|
</span>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<div class="panel-body">
|
|
<?php
|
|
$formOptions = ['id' => $progressFormId, 'enctype' => 'multipart/form-data'];
|
|
if (!$isInline) {
|
|
$formOptions['target'] = '_top';
|
|
}
|
|
$form = ActiveForm::begin(['options' => $formOptions]);
|
|
?>
|
|
<?= Html::hiddenInput('returnTo', (string)($returnTo ?? 'view')) ?>
|
|
|
|
<?= $form->errorSummary($model, ['showAllErrors' => true]) ?>
|
|
|
|
<div class="panel panel-default" style="margin-bottom:12px;">
|
|
<div class="panel-heading">
|
|
<a data-toggle="collapse" href="#edit-progress-section-update" aria-expanded="true" aria-controls="edit-progress-section-update">
|
|
<strong><?= Yii::t('AnimalManagementModule.base', 'Progress Update') ?></strong>
|
|
</a>
|
|
</div>
|
|
<div id="edit-progress-section-update" class="panel-collapse collapse in" aria-expanded="true">
|
|
<div class="panel-body" style="padding-bottom:8px;">
|
|
<div class="row">
|
|
<div class="col-sm-4"><?= $form->field($model, 'weight') ?></div>
|
|
<div class="col-sm-8"><?= $form->field($model, 'vitals')->textInput(['maxlength' => 255]) ?></div>
|
|
<div class="col-sm-6"><?= $form->field($model, 'behavior_notes')->textarea(['rows' => 2]) ?></div>
|
|
<div class="col-sm-6"><?= $form->field($model, 'medical_concerns')->textarea(['rows' => 2]) ?></div>
|
|
<div class="col-sm-6"><?= $form->field($model, 'meal_plan_changes')->textarea(['rows' => 2]) ?></div>
|
|
<div class="col-sm-6"><?= $form->field($model, 'housing_changes')->textarea(['rows' => 2]) ?></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel panel-default" style="margin-bottom:12px;">
|
|
<div class="panel-heading">
|
|
<a data-toggle="collapse" href="#edit-progress-section-notes" aria-expanded="true" aria-controls="edit-progress-section-notes">
|
|
<strong><?= Yii::t('AnimalManagementModule.base', 'Notes') ?></strong>
|
|
</a>
|
|
</div>
|
|
<div id="edit-progress-section-notes" class="panel-collapse collapse in" aria-expanded="true">
|
|
<div class="panel-body" style="padding-bottom:8px;">
|
|
<?= $renderCustomField('progress_notes', $model, $customDefinitions) ?>
|
|
<?= $renderCustomField('routine_updates', $model, $customDefinitions) ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (!empty($otherCustomDefinitions)): ?>
|
|
<div class="panel panel-default" style="margin-bottom:12px;">
|
|
<div class="panel-heading">
|
|
<a data-toggle="collapse" href="#edit-progress-section-additional" aria-expanded="true" aria-controls="edit-progress-section-additional">
|
|
<strong><?= Yii::t('AnimalManagementModule.base', 'Additional Details') ?></strong>
|
|
</a>
|
|
</div>
|
|
<div id="edit-progress-section-additional" class="panel-collapse collapse in" aria-expanded="true">
|
|
<div class="panel-body" style="padding-bottom:8px;">
|
|
<?php foreach ($otherCustomDefinitions as $fieldKey => $definition): ?>
|
|
<?= $renderCustomField($fieldKey, $model, $otherCustomDefinitions) ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="panel panel-default" style="margin-bottom:12px;">
|
|
<div class="panel-heading">
|
|
<a data-toggle="collapse" href="#edit-progress-section-media" aria-expanded="true" aria-controls="edit-progress-section-media">
|
|
<strong><?= Yii::t('AnimalManagementModule.base', 'Media') ?></strong>
|
|
</a>
|
|
</div>
|
|
<div id="edit-progress-section-media" class="panel-collapse collapse in" aria-expanded="true">
|
|
<div class="panel-body" style="padding-bottom:8px;">
|
|
<input type="hidden" id="progress-media-gallery-path" name="progressMediaGalleryPath" value="<?= Html::encode($currentMediaReference) ?>">
|
|
<div class="row">
|
|
<div class="col-sm-4" style="margin-bottom:8px;">
|
|
<div id="progress-media-preview" style="border-radius:8px;overflow:hidden;background:#f2f4f6;height:150px;display:flex;align-items:center;justify-content:center;">
|
|
<?php if ($currentMediaReference !== '' && (preg_match('/^https?:\/\//i', $currentMediaReference) || substr($currentMediaReference, 0, 1) === '/')): ?>
|
|
<img src="<?= Html::encode($currentMediaReference) ?>" alt="<?= Yii::t('AnimalManagementModule.base', 'Selected media') ?>" style="width:100%;height:100%;object-fit:cover;">
|
|
<?php else: ?>
|
|
<i class="fa fa-image fa-2x" style="color:#a7b0b8;"></i>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-8">
|
|
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#progress-media-modal" style="margin-bottom:8px;">
|
|
<i class="fa fa-photo"></i> <?= Yii::t('AnimalManagementModule.base', 'Choose from Gallery or Upload') ?>
|
|
</button>
|
|
|
|
<div class="checkbox" style="margin-top:0;">
|
|
<label>
|
|
<input type="checkbox" name="removeProgressMedia" value="1">
|
|
<?= Yii::t('AnimalManagementModule.base', 'Remove selected media') ?>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel panel-default" style="margin-bottom:12px;">
|
|
<div class="panel-heading"><strong><?= Yii::t('AnimalManagementModule.base', 'Social Post') ?></strong></div>
|
|
<div class="panel-body" style="padding-bottom:8px;">
|
|
<?= $form->field($model, 'post_to_space_feed')->checkbox() ?>
|
|
<?= $form->field($model, 'post_to_animal_feed')->checkbox() ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="progress-media-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="<?= Yii::t('AnimalManagementModule.base', 'Close') ?>"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title"><?= Yii::t('AnimalManagementModule.base', 'Select Progress Media') ?></h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<?php if (empty($galleryItems)): ?>
|
|
<div class="text-muted" style="margin-bottom:10px;"><?= Yii::t('AnimalManagementModule.base', 'No gallery images available yet.') ?></div>
|
|
<?php else: ?>
|
|
<div class="row" style="max-height:280px;overflow:auto;margin-bottom:10px;">
|
|
<?php foreach ($galleryItems as $galleryItem): ?>
|
|
<?php $galleryUrl = trim((string)$galleryItem->getImageUrl()); ?>
|
|
<?php if ($galleryUrl === '') { continue; } ?>
|
|
<div class="col-xs-6 col-sm-4" style="margin-bottom:8px;">
|
|
<button type="button" class="btn btn-default progress-media-select-thumb<?= $currentMediaReference === $galleryUrl ? ' is-selected' : '' ?>" data-media-url="<?= Html::encode($galleryUrl) ?>" style="width:100%;padding:3px;">
|
|
<img src="<?= Html::encode($galleryUrl) ?>" alt="<?= Yii::t('AnimalManagementModule.base', 'Gallery image') ?>" style="width:100%;height:120px;object-fit:cover;border-radius:4px;">
|
|
</button>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="form-group" style="margin-bottom:0;">
|
|
<label class="control-label" for="progressMediaUpload"><?= Yii::t('AnimalManagementModule.base', 'Upload New Image') ?></label>
|
|
<input type="file" class="form-control" id="progressMediaUpload" name="progressMediaUpload" accept="image/*">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?= Button::save(Yii::t('AnimalManagementModule.base', 'Save Progress Update'))->submit() ?>
|
|
<?php if (!$isInline): ?>
|
|
<?= Button::asLink(Yii::t('AnimalManagementModule.base', 'Cancel'))
|
|
->link(($returnTo ?? 'view') === 'progress-updates'
|
|
? $space->createUrl('/animal_management/animals/progress-updates', ['id' => $animal->id])
|
|
: $space->createUrl('/animal_management/animals/view', ['id' => $animal->id])) ?>
|
|
<?php endif; ?>
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
$this->registerCss(<<<CSS
|
|
.progress-media-select-thumb.is-selected {
|
|
border-color: #2f7df4 !important;
|
|
box-shadow: 0 0 0 2px rgba(47, 125, 244, 0.22);
|
|
}
|
|
CSS
|
|
);
|
|
|
|
$this->registerJs(<<<JS
|
|
(function() {
|
|
function renderProgressPreview(source) {
|
|
var preview = $('#progress-media-preview');
|
|
if (!preview.length) {
|
|
return;
|
|
}
|
|
|
|
if (source) {
|
|
preview.html('<img src="' + source + '" alt="Selected media" style="width:100%;height:100%;object-fit:cover;">');
|
|
} else {
|
|
preview.html('<i class="fa fa-image fa-2x" style="color:#a7b0b8;"></i>');
|
|
}
|
|
}
|
|
|
|
function markSelectedMediaThumb(value) {
|
|
$('.progress-media-select-thumb').removeClass('is-selected');
|
|
if (!value) {
|
|
return;
|
|
}
|
|
|
|
$('.progress-media-select-thumb').each(function() {
|
|
if (($(this).attr('data-media-url') || '') === value) {
|
|
$(this).addClass('is-selected');
|
|
}
|
|
});
|
|
}
|
|
|
|
$(document).off('click.editProgressMediaSelect', '.progress-media-select-thumb').on('click.editProgressMediaSelect', '.progress-media-select-thumb', function() {
|
|
var mediaUrl = $(this).attr('data-media-url') || '';
|
|
$('#progress-media-gallery-path').val(mediaUrl);
|
|
markSelectedMediaThumb(mediaUrl);
|
|
$('#progressMediaUpload').val('');
|
|
$('input[name="removeProgressMedia"]').prop('checked', false);
|
|
if (mediaUrl) {
|
|
renderProgressPreview(mediaUrl);
|
|
}
|
|
$('#progress-media-modal').modal('hide');
|
|
});
|
|
|
|
$(document).off('change.editProgressMediaUpload', '#progressMediaUpload').on('change.editProgressMediaUpload', '#progressMediaUpload', function() {
|
|
var file = this.files && this.files[0] ? this.files[0] : null;
|
|
if (!file) {
|
|
return;
|
|
}
|
|
|
|
$('#progress-media-gallery-path').val('');
|
|
markSelectedMediaThumb('');
|
|
$('input[name="removeProgressMedia"]').prop('checked', false);
|
|
|
|
var reader = new FileReader();
|
|
reader.onload = function(e) {
|
|
renderProgressPreview(e.target.result);
|
|
$('#progress-media-modal').modal('hide');
|
|
};
|
|
reader.readAsDataURL(file);
|
|
});
|
|
|
|
$(document).off('shown.bs.modal.editProgressMediaModal', '#progress-media-modal').on('shown.bs.modal.editProgressMediaModal', '#progress-media-modal', function() {
|
|
markSelectedMediaThumb($('#progress-media-gallery-path').val());
|
|
});
|
|
})();
|
|
JS
|
|
, \yii\web\View::POS_END);
|
|
|
|
if ($isInline) {
|
|
$cancelPayload = Json::htmlEncode([
|
|
'source' => 'animal-inline-editor',
|
|
'type' => 'cancel',
|
|
'collapseId' => 'progress-edit-inline-' . (int)$progressUpdate->id,
|
|
]);
|
|
|
|
$this->registerJs(<<<JS
|
|
(function() {
|
|
function postInlineCancel() {
|
|
if (window.parent && window.parent !== window) {
|
|
window.parent.postMessage($cancelPayload, '*');
|
|
}
|
|
}
|
|
|
|
if (window.jQuery) {
|
|
window.jQuery(document).on('click', '#progress-inline-cancel, #progress-inline-cancel-icon', function() {
|
|
postInlineCancel();
|
|
});
|
|
}
|
|
|
|
document.addEventListener('click', function(event) {
|
|
var target = event.target;
|
|
if (!target || !target.closest) {
|
|
return;
|
|
}
|
|
|
|
if (!target.closest('#progress-inline-cancel, #progress-inline-cancel-icon')) {
|
|
return;
|
|
}
|
|
|
|
postInlineCancel();
|
|
}, false);
|
|
})();
|
|
JS
|
|
, \yii\web\View::POS_END);
|
|
}
|
|
?>
|