diff --git a/admin/themes/default/js/admin-theme.js b/admin/themes/default/js/admin-theme.js index c2dfc6de2..e8c42601d 100644 --- a/admin/themes/default/js/admin-theme.js +++ b/admin/themes/default/js/admin-theme.js @@ -478,41 +478,42 @@ $(document).ready(function() { $('.no-htl-access-option').on('click', function() { $(this).prop('selected', false); }); + initTooltip(); }); //end dom ready - -function initTooltip() { - if (!$('.tooltip-trigger').length) { - return; - } - $('.tooltip-trigger').each(function () { - if ($(this).data('ui-tooltip')) { - return; - } - $(this).tooltip({ - content: $(this).siblings('.tooltip-content').html(), - items: 'span', - trigger: 'hover', - tooltipClass: 'tooltip-popup', - open: function (event, ui) { - if (typeof event.originalEvent === 'undefined') { - return false; - } - var $id = $(ui.tooltip).attr('id'); - if ($('div.ui-tooltip').not('#' + $id).length) { - return false; - } - }, - close: function (event, ui) { - ui.tooltip.hover( - function () { $(this).stop(true).fadeTo(400, 1); }, - function () { $(this).fadeOut(400, function () { $(this).remove(); }); } - ); - } - }); - }); +function initTooltip($target, contentFn, items) { + var $elements = $target || $('.tooltip-trigger'); + if (!$elements.length) { + return; + } + $elements.each(function () { + var $this = $(this); + if (!contentFn && $this.data('ui-tooltip')) { + return; + } + $this.tooltip({ + content: contentFn || $this.next('.tooltip-content').html(), + items: items || 'span', + trigger: 'hover', + tooltipClass: 'tooltip-popup', + open: function (event, ui) { + if (event.buttons == 1 || event.buttons == 3) { + ui.tooltip.remove(); + } + if (typeof event.originalEvent === 'undefined') { + return false; + } + var $id = $(ui.tooltip).attr('id'); + if ($('div.ui-tooltip').not('#' + $id).length) { + return false; + } + }, + close: function (event, ui) { + ui.tooltip.hover( + function () { $(this).stop(true).fadeTo(300, 1); }, + function () { $(this).fadeOut(300, function () { $(this).remove(); }); } + ); + } + }); + }); } - -$(document).ready(function () { - initTooltip(); -}); \ No newline at end of file diff --git a/admin/themes/default/js/modernizr-loads.js b/admin/themes/default/js/modernizr-loads.js index aa738e542..f4142963e 100644 --- a/admin/themes/default/js/modernizr-loads.js +++ b/admin/themes/default/js/modernizr-loads.js @@ -3,6 +3,10 @@ Modernizr.load([ test: window.matchMedia, nope: ["themes/default/js/vendor/matchMedia.js", "themes/default/js/vendor/matchMedia.addListener.js"] }, - "themes/default/js/vendor/enquire.min.js", - "themes/default/js/admin-theme.js", + { + load: ["themes/default/js/vendor/enquire.min.js", "themes/default/js/admin-theme.js"], + complete: function() { + $(document).trigger('admin-theme.js.ready'); + } + } ]); \ No newline at end of file diff --git a/admin/themes/default/sass/partials/_content.sass b/admin/themes/default/sass/partials/_content.sass index 40440a436..ab40342f3 100644 --- a/admin/themes/default/sass/partials/_content.sass +++ b/admin/themes/default/sass/partials/_content.sass @@ -309,36 +309,3 @@ body.display-modal .page-topbar #help-container margin-top: 140px -.tooltip-trigger - cursor: pointer - display: inline-block - vertical-align: middle - margin-left: 4px - -.ui-tooltip.tooltip-popup - background: #ffffff - border: 1px solid #ddd - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) - color: #333333 - padding: 8px 12px - font-size: 13px - ul - margin: 0 - padding: 0 0 0 16px - list-style: disc - li - padding: 2px 0 - -.tooltip-row - display: flex - justify-content: space-between - align-items: center - gap: 12px - margin: 3px 0 - white-space: nowrap - label - font-weight: 600 - margin: 0 - -.tooltip-cont - max-width: 200px diff --git a/admin/themes/default/sass/partials/_tooltip.sass b/admin/themes/default/sass/partials/_tooltip.sass index 986d49667..d1f445386 100644 --- a/admin/themes/default/sass/partials/_tooltip.sass +++ b/admin/themes/default/sass/partials/_tooltip.sass @@ -1,5 +1,4 @@ .tooltip_cont - min-width: 280px width: 100% font-size: 14px font-weight: 600 @@ -7,6 +6,7 @@ margin-bottom: 10px .tip-body > div margin-bottom: 6px + margin-right: 10px .tip_element_head font-size: 12px @@ -28,3 +28,30 @@ border: none padding: 10px box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.15) + width: auto + +.tooltip-trigger + cursor: pointer + display: inline-block + vertical-align: middle + + + +.ui-tooltip.tooltip-popup + ul + margin: 0 + padding: 0 0 0 16px + list-style: disc + li + padding: 2px 0 + +.tooltip-popup-row + display: flex + justify-content: space-between + align-items: center + gap: 12px + margin: 3px 0 + white-space: nowrap + label + font-weight: 600 + margin: 0 diff --git a/admin/themes/default/template/controllers/normal_products/_price_calculation_method_options.tpl b/admin/themes/default/template/controllers/normal_products/_price_calculation_method_options.tpl new file mode 100644 index 000000000..5f6a22d5e --- /dev/null +++ b/admin/themes/default/template/controllers/normal_products/_price_calculation_method_options.tpl @@ -0,0 +1,30 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +{capture name='tooltip_list_content'} + +{/capture} +{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.tooltip_list_content allow_html=true} diff --git a/admin/themes/default/template/controllers/orders/_stay_periods_tooltip.tpl b/admin/themes/default/template/controllers/orders/_stay_periods_tooltip.tpl new file mode 100644 index 000000000..eb98c6735 --- /dev/null +++ b/admin/themes/default/template/controllers/orders/_stay_periods_tooltip.tpl @@ -0,0 +1,47 @@ +{** +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +{capture name='stay_periods_tooltip'} +
+
+
{l s='Stay Periods'}
+
+ + + + + + + + + {foreach from=$stay_periods item=stay_period} + + + + + {/foreach} + +
{l s='Duration'}{l s='Rooms'}
{$stay_period.from} – {$stay_period.to}{$stay_period.count}
+
+{/capture} +{capture name='stay_periods_tooltip_title'}+{$extra_stay_periods_count}{/capture} +{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.stay_periods_tooltip tooltip_title=$smarty.capture.stay_periods_tooltip_title} diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 119cda3e3..20742428c 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -1404,6 +1404,7 @@ { $("#customer_cart_details").empty(); $("#customer_cart_details").append(res.cart_detail_html); + initTooltip(); displaySummary(res); } diff --git a/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl index 3d87a0286..c7229872a 100644 --- a/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_add_order_extra_services_tab_content.tpl @@ -66,7 +66,7 @@ {capture name='room_type_service_tooltip_content'} {assign var="priceCalcMethod" value=$product['price_calculation_method']|default:0}
-
+