diff --git a/app/main/model/characterlogmodel.php b/app/main/model/characterlogmodel.php index 57651f5f..5361b42b 100644 --- a/app/main/model/characterlogmodel.php +++ b/app/main/model/characterlogmodel.php @@ -219,7 +219,7 @@ class CharacterLogModel extends BasicModel { public function clearCacheData(){ // clear character "LOG" cache // -> character data without "LOG" has not changed! - if($this->characterId){ + if(is_object($this->characterId)){ // characterId relation could be deleted by cron therefore check again first... $this->characterId->clearCacheDataWithPrefix(CharacterModel::DATA_CACHE_KEY_LOG); diff --git a/js/app/map/map.js b/js/app/map/map.js index f626c38c..e7fb813a 100644 --- a/js/app/map/map.js +++ b/js/app/map/map.js @@ -58,8 +58,6 @@ define([ systemDialogId: 'pf-system-dialog', // id for system dialog systemDialogSelectClass: 'pf-system-dialog-select', // class for system select Element - popoverTriggerClass: 'pf-popover-trigger', // class for "popover" trigger elements - // system security classes systemSec: 'pf-system-sec' }; @@ -397,7 +395,7 @@ define([ }).attr('title', 'locked'), // System effect color $('', { - class: ['fas', 'fa-square', 'fa-fw', effectBasicClass, effectClass, config.popoverTriggerClass].join(' ') + class: ['fas', 'fa-square', 'fa-fw', effectBasicClass, effectClass, Util.config.popoverTriggerClass].join(' ') }), // expand option $('', { diff --git a/js/app/map/system.js b/js/app/map/system.js index 112daa16..b2792a46 100644 --- a/js/app/map/system.js +++ b/js/app/map/system.js @@ -21,8 +21,6 @@ define([ mapClass: 'pf-map', // class for all maps - popoverTriggerClass: 'pf-popover-trigger', // class for "popover" trigger elements - systemHeadInfoClass: 'pf-system-head-info', // class for system info systemHeadInfoLeftClass: 'pf-system-head-info-left', // class for left system info systemHeadInfoRightClass: 'pf-system-head-info-right', // class for right system info @@ -508,7 +506,7 @@ define([ headInfoRight.push( '' + staticData.security + '' ); } diff --git a/js/app/page.js b/js/app/page.js index d513ad7b..70316d3f 100644 --- a/js/app/page.js +++ b/js/app/page.js @@ -710,12 +710,20 @@ define([ // END menu events ============================================================================= + // global "popover" callback (for all popovers) + $('.' + Util.config.popoverTriggerClass).on('hide.bs.popover', function(e) { + let popoverElement = $(this).data('bs.popover').tip(); + + // destroy all active tooltips inside this popover + popoverElement.destroyTooltip(true); + }); + // global "modal" callback (for all modals) - $('body').on('hide.bs.modal', '> .modal', function(a,b) { + $('body').on('hide.bs.modal', '> .modal', function(e) { $(this).destroyTimestampCounter(); }); - // disable memue links based on current map config + // disable menu links based on current map config documentElement.on('pf:updateMenuOptions', function(e, data){ let hasRightMapDelete = MapUtil.checkRight('map_delete', data.mapConfig); $('#' + Util.config.menuButtonMapDeleteId).toggleClass('disabled', !hasRightMapDelete); diff --git a/js/app/util.js b/js/app/util.js index 35bab6d1..24362f40 100644 --- a/js/app/util.js +++ b/js/app/util.js @@ -467,7 +467,6 @@ define([ * @returns {*} */ $.fn.initTooltips = function(options){ - options = (typeof options === 'object') ? options : {}; let defaultOptions = { @@ -482,6 +481,26 @@ define([ }); }; + /** + * destroy popover elements + * @param recursive + * @returns {*} + */ + $.fn.destroyTooltip = function(recursive){ + return this.each(function() { + let element = $(this); + let tooltipSelector = '[title]'; + let tooltipElements = element.filter(tooltipSelector); + if(recursive){ + tooltipElements = tooltipElements.add(element.find(tooltipSelector)); + } + + tooltipElements.each(function() { + $(this).tooltip('destroy'); + }); + }); + }; + /** * adds a popup tooltip with character information (created/updated) * @param tooltipData @@ -585,7 +604,7 @@ define([ return elements.each(function() { let element = $(this); - // check if tooltip already exists -> remove it + // check if popover already exists -> remove it if(element.data('bs.popover') !== undefined){ element.off('click').popover('destroy'); } @@ -658,6 +677,11 @@ define([ }); }; + /** + * destroy popover elements + * @param recursive + * @returns {*} + */ $.fn.destroyPopover = function(recursive){ return this.each(function() { let element = $(this); @@ -684,7 +708,6 @@ define([ $.fn.initPopoverClose = function(eventNamespace){ return this.each(function() { $('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function (e) { - $('.' + config.popoverTriggerClass).each(function () { let popoverElement = $(this); //the 'is' for buttons that trigger popups diff --git a/public/js/v1.3.6/app/map/map.js b/public/js/v1.3.6/app/map/map.js index f626c38c..e7fb813a 100644 --- a/public/js/v1.3.6/app/map/map.js +++ b/public/js/v1.3.6/app/map/map.js @@ -58,8 +58,6 @@ define([ systemDialogId: 'pf-system-dialog', // id for system dialog systemDialogSelectClass: 'pf-system-dialog-select', // class for system select Element - popoverTriggerClass: 'pf-popover-trigger', // class for "popover" trigger elements - // system security classes systemSec: 'pf-system-sec' }; @@ -397,7 +395,7 @@ define([ }).attr('title', 'locked'), // System effect color $('', { - class: ['fas', 'fa-square', 'fa-fw', effectBasicClass, effectClass, config.popoverTriggerClass].join(' ') + class: ['fas', 'fa-square', 'fa-fw', effectBasicClass, effectClass, Util.config.popoverTriggerClass].join(' ') }), // expand option $('', { diff --git a/public/js/v1.3.6/app/map/system.js b/public/js/v1.3.6/app/map/system.js index 112daa16..b2792a46 100644 --- a/public/js/v1.3.6/app/map/system.js +++ b/public/js/v1.3.6/app/map/system.js @@ -21,8 +21,6 @@ define([ mapClass: 'pf-map', // class for all maps - popoverTriggerClass: 'pf-popover-trigger', // class for "popover" trigger elements - systemHeadInfoClass: 'pf-system-head-info', // class for system info systemHeadInfoLeftClass: 'pf-system-head-info-left', // class for left system info systemHeadInfoRightClass: 'pf-system-head-info-right', // class for right system info @@ -508,7 +506,7 @@ define([ headInfoRight.push( '' + staticData.security + '' ); } diff --git a/public/js/v1.3.6/app/page.js b/public/js/v1.3.6/app/page.js index d513ad7b..70316d3f 100644 --- a/public/js/v1.3.6/app/page.js +++ b/public/js/v1.3.6/app/page.js @@ -710,12 +710,20 @@ define([ // END menu events ============================================================================= + // global "popover" callback (for all popovers) + $('.' + Util.config.popoverTriggerClass).on('hide.bs.popover', function(e) { + let popoverElement = $(this).data('bs.popover').tip(); + + // destroy all active tooltips inside this popover + popoverElement.destroyTooltip(true); + }); + // global "modal" callback (for all modals) - $('body').on('hide.bs.modal', '> .modal', function(a,b) { + $('body').on('hide.bs.modal', '> .modal', function(e) { $(this).destroyTimestampCounter(); }); - // disable memue links based on current map config + // disable menu links based on current map config documentElement.on('pf:updateMenuOptions', function(e, data){ let hasRightMapDelete = MapUtil.checkRight('map_delete', data.mapConfig); $('#' + Util.config.menuButtonMapDeleteId).toggleClass('disabled', !hasRightMapDelete); diff --git a/public/js/v1.3.6/app/util.js b/public/js/v1.3.6/app/util.js index 35bab6d1..24362f40 100644 --- a/public/js/v1.3.6/app/util.js +++ b/public/js/v1.3.6/app/util.js @@ -467,7 +467,6 @@ define([ * @returns {*} */ $.fn.initTooltips = function(options){ - options = (typeof options === 'object') ? options : {}; let defaultOptions = { @@ -482,6 +481,26 @@ define([ }); }; + /** + * destroy popover elements + * @param recursive + * @returns {*} + */ + $.fn.destroyTooltip = function(recursive){ + return this.each(function() { + let element = $(this); + let tooltipSelector = '[title]'; + let tooltipElements = element.filter(tooltipSelector); + if(recursive){ + tooltipElements = tooltipElements.add(element.find(tooltipSelector)); + } + + tooltipElements.each(function() { + $(this).tooltip('destroy'); + }); + }); + }; + /** * adds a popup tooltip with character information (created/updated) * @param tooltipData @@ -585,7 +604,7 @@ define([ return elements.each(function() { let element = $(this); - // check if tooltip already exists -> remove it + // check if popover already exists -> remove it if(element.data('bs.popover') !== undefined){ element.off('click').popover('destroy'); } @@ -658,6 +677,11 @@ define([ }); }; + /** + * destroy popover elements + * @param recursive + * @returns {*} + */ $.fn.destroyPopover = function(recursive){ return this.each(function() { let element = $(this); @@ -684,7 +708,6 @@ define([ $.fn.initPopoverClose = function(eventNamespace){ return this.each(function() { $('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function (e) { - $('.' + config.popoverTriggerClass).each(function () { let popoverElement = $(this); //the 'is' for buttons that trigger popups