<?php use yii\helpers\Html; use yii\jui\Draggable; /* @var $this yii\web\View */ /* @var $unscheduled common\models\Ticket[] */ foreach ($unscheduled as $ticket) { Draggable::begin(['options' => ['id' => 'unscheduled' . $ticket->id, 'class' => ['fc-event', 'future', $ticket->status_id == $ticket::STATUS_IN_PROGRESS ? 'overdue' : 'remote'], 'data' => ['location' => $ticket->invoice_id, 'ticket' => $ticket->id]], 'clientOptions' => ['revert' => true, 'revertDuration' => 0, 'zIndex' => 999]]); echo Html::a('<div class="fc-content">' . Html::encode($ticket->invoice->location->fullName) . '<br>' . Html::encode($ticket->fullName) . '</div>', ['ticket/view', 'id' => $ticket->id], ['class' => 'showModalButton']); Draggable::end(); }
z-index: 0 !important; } .modal-dialog{ position: absolute; right: 0; bottom: 0; z-index: 1; } </style> <div class="container"> <?php echo Html::button('Написать сообщение', ['class' => 'btn btn-sm btn-primary', 'data-toggle' => 'modal', 'data-target' => '#myChatModal']); ?> <?php Draggable::begin(['clientOptions' => ['grid' => [50, 20]]]); Modal::begin(['size' => 'modal-sm', 'id' => 'myChatModal', 'header' => '<h4 class="text-center" style="">Перетащи меня</h4>', 'headerOptions' => ['style' => 'cursor: move;'], 'toggleButton' => false, 'clientOptions' => ['backdrop' => false, 'keyboard' => false], 'options' => ['class' => 'draggable']]); ?> <div id="notifications"></div> <?php Pjax::begin(['id' => 'modalChat', 'enablePushState' => false, 'timeout' => 9000]); ?> <?php $form = ActiveForm::begin(['id' => 'chat-form', 'options' => ['data-pjax' => true]]); ?> <?php echo $form->field($modelChatForm, 'name'); ?> <?php echo $form->field($modelChatForm, 'message'); ?>
\$("#myChatModal").modal("show"); }); }); JS; $this->registerJs($script); ?> <div class="container"> <?php echo Html::button('Написать сообщение', ['class' => 'btn btn-sm btn-primary', 'onclick' => '$("#chatBlock").show();']); ?> </div> <?php Draggable::begin(['options' => ['class' => 'col-md-3 col-sm-4 col-xs-12', 'style' => ' position: fixed; bottom: 50px; right: 0; margin-right: 0; margin-bottom: 0;'], 'clientOptions' => []]); ?> <div id="chatBlock" class="modal-content" style="display: none;"> <div class="modal-header ui-draggable-handle" style="cursor: move;"> <?php echo Html::button('×', ['class' => 'close', 'onclick' => '$("#chatBlock").hide();']); ?> <h4 id="headerChat" class="text-center" style="">Перетащи меня</h4> </div> <div class="modal-body"> <div id="notifications" style="max-height: 100px; height: 100px; overflow-y: scroll"></div> <?php Pjax::begin(['id' => 'modalChat', 'enablePushState' => false, 'timeout' => 9000]); ?>