@@ -20,38 +20,38 @@
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
.stay-period-tooltip {
|
||||
.qlo-stay-period-tooltip {
|
||||
border: none;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
padding-bottom: 10px;
|
||||
min-width: 260px;
|
||||
}
|
||||
.stay-period-tooltip .tip_date {
|
||||
.qlo-stay-period-tooltip .qlo-tip-date {
|
||||
font-weight: bold;
|
||||
}
|
||||
.stay-period-tooltip .tip-body {
|
||||
.qlo-stay-period-tooltip .qlo-tip-body {
|
||||
display: table;
|
||||
width: 100%;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.stay-period-tooltip .stay_period {
|
||||
.qlo-stay-period-tooltip .qlo-stay-period {
|
||||
display: table-row;
|
||||
}
|
||||
.stay-period-tooltip .tip_element_head,
|
||||
.stay-period-tooltip .tip_element_value {
|
||||
.qlo-stay-period-tooltip .qlo-tip-element-head,
|
||||
.qlo-stay-period-tooltip .qlo-tip-element-value {
|
||||
display: table-cell;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
.stay-period-tooltip .tip_element_value {
|
||||
.qlo-stay-period-tooltip .qlo-tip-element-value {
|
||||
text-align: right;
|
||||
}
|
||||
.stay-period-tooltip .stay_period_header .tip_element_head,
|
||||
.stay-period-tooltip .stay_period_header .tip_element_value {
|
||||
.qlo-stay-period-tooltip .qlo-stay-period-header .qlo-tip-element-head,
|
||||
.qlo-stay-period-tooltip .qlo-stay-period-header .qlo-tip-element-value {
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.stay-period-badge {
|
||||
.qlo-stay-period-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
style="display:none;"
|
||||
data-label-dates="{l s='Dates'}"
|
||||
data-label-rooms="{l s='Rooms'}">
|
||||
<div class="tooltip_cont">
|
||||
<div class="tip_header">
|
||||
<div class="tip_date">{l s='Stay Periods'}</div>
|
||||
<div class="qlo-tooltip-cont">
|
||||
<div class="qlo-tip-header">
|
||||
<div class="qlo-tip-date">{l s='Stay Periods'}</div>
|
||||
</div>
|
||||
<div class="tip-body"></div>
|
||||
<div class="qlo-tip-body"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -397,7 +397,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$totalRooms = array_sum(array_column($formatted, 'count'));
|
||||
|
||||
if ($totalRooms > 1) {
|
||||
$output .= ' <span class="stay-period-badge stay-period-tip" data-stay-tip="'
|
||||
$output .= ' <span class="qlo-stay-period-badge qlo-stay-period-tip" data-stay-tip="'
|
||||
.htmlspecialchars(json_encode($formatted)).'">+'
|
||||
.($totalRooms - 1).'</span>';
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Stay Periods tooltip initialisation for the Admin Orders list.
|
||||
* Reads structured JSON from data-stay-tip on each .stay-period-tip icon,
|
||||
* Reads structured JSON from data-stay-tip on each .qlo-stay-period-tip icon,
|
||||
* clones the hidden #stay-period-tpl template, fills it, and returns it
|
||||
* as the jQuery UI tooltip content.
|
||||
*/
|
||||
@@ -8,26 +8,26 @@ $(document).ready(function () {
|
||||
var closeTimer = null;
|
||||
|
||||
function buildTooltip(periods) {
|
||||
var $tpl = $('#stay-period-tpl .tooltip_cont').clone();
|
||||
var $body = $tpl.find('.tip-body').empty();
|
||||
var $tpl = $('#stay-period-tpl .qlo-tooltip-cont').clone();
|
||||
var $body = $tpl.find('.qlo-tip-body').empty();
|
||||
|
||||
$body.append(
|
||||
$('<div class="stay_period stay_period_header">').append(
|
||||
$('<span class="tip_element_head">').text($('#stay-period-tpl').data('label-dates')),
|
||||
$('<span class="tip_element_value">').text($('#stay-period-tpl').data('label-rooms'))
|
||||
$('<div class="qlo-stay-period qlo-stay-period-header">').append(
|
||||
$('<span class="qlo-tip-element-head">').text($('#stay-period-tpl').data('label-dates')),
|
||||
$('<span class="qlo-tip-element-value">').text($('#stay-period-tpl').data('label-rooms'))
|
||||
)
|
||||
);
|
||||
|
||||
$.each(periods, function (_, p) {
|
||||
$body.append(
|
||||
$('<div class="stay_period">').append(
|
||||
$('<span class="tip_element_head">').text(p.from + ' – ' + p.to),
|
||||
$('<span class="tip_element_value">').text(p.count)
|
||||
$('<div class="qlo-stay-period">').append(
|
||||
$('<span class="qlo-tip-element-head">').text(p.from + ' – ' + p.to),
|
||||
$('<span class="qlo-tip-element-value">').text(p.count)
|
||||
)
|
||||
);
|
||||
});
|
||||
return $('<div>', {
|
||||
'class': 'ui-tooltip ui-widget ui-corner-all ui-widget-content stay-period-tooltip',
|
||||
'class': 'ui-tooltip ui-widget ui-corner-all ui-widget-content qlo-stay-period-tooltip',
|
||||
'role' : 'tooltip'
|
||||
}).append(
|
||||
$('<div class="ui-tooltip-content">').append($tpl)
|
||||
@@ -46,13 +46,13 @@ $(document).ready(function () {
|
||||
}, 300);
|
||||
}
|
||||
|
||||
$(document).on('mouseenter', '.stay-period-tip', function () {
|
||||
$(document).on('mouseenter', '.qlo-stay-period-tip', function () {
|
||||
cancelClose();
|
||||
|
||||
var periods = $(this).data('stay-tip');
|
||||
if (!periods || !periods.length) { return; }
|
||||
|
||||
$('.stay-period-tooltip').stop(true).remove();
|
||||
$('.qlo-stay-period-tooltip').stop(true).remove();
|
||||
|
||||
var $icon = $(this);
|
||||
var $tip = buildTooltip(periods).appendTo('body').hide().fadeIn(200);
|
||||
@@ -71,8 +71,8 @@ $(document).ready(function () {
|
||||
scheduleClose($tip);
|
||||
});
|
||||
|
||||
}).on('mouseleave', '.stay-period-tip', function () {
|
||||
var $tip = $('.stay-period-tooltip');
|
||||
}).on('mouseleave', '.qlo-stay-period-tip', function () {
|
||||
var $tip = $('.qlo-stay-period-tooltip');
|
||||
if ($tip.length) {
|
||||
scheduleClose($tip);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user