diff --git a/Plugin/View/LayoutPlugin.php b/Plugin/View/LayoutPlugin.php index f1fc14f..f68fa15 100644 --- a/Plugin/View/LayoutPlugin.php +++ b/Plugin/View/LayoutPlugin.php @@ -197,6 +197,7 @@ protected function _getBlockInfo($name) $result = json_encode([ 'name' => addslashes($block->getNameInLayout()), 'templateFile' => $this->_getBlockTemplatePath($block), + 'absolutePath' => $block->getTemplateFile(), 'moduleName' => $block->getModuleName(), 'class' => addslashes(get_class($block)), 'cache' => ['keyInfo' => $block->getCacheKeyInfo()], diff --git a/view/base/web/js/hints.js b/view/base/web/js/hints.js index 187a733..ea8ad58 100644 --- a/view/base/web/js/hints.js +++ b/view/base/web/js/hints.js @@ -49,7 +49,7 @@ document.addEventListener("DOMContentLoaded", function(event) { }) - $(document).on('mouseout', '.ho-hint', function(event){ + $(document).on('mouseout', '.ho-hint', function(event){ if (!event.shiftKey) { return } @@ -106,11 +106,22 @@ document.addEventListener("DOMContentLoaded", function(event) { console.log(hintData[key]); }) console.log(hintData['cache']) + console.log('http://localhost:63342/api/file/'+hintData['absolutePath']); console.log(elem) console.groupEnd() break; } } + + window.openTemplate = function(elem) { + var hintElem = $(elem) + var hintData = hintElem.data('ho-hintdata'); + hintElem.removeAttr('data-ho-hintdata') + + if (hintData['absolutePath']) { + $.get('http://localhost:63342/api/file/'+hintData['absolutePath']); + } + } }) })