From 08ce7b18a8b9649fe2ce8875b61ae0a8c319d658 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 12 Sep 2023 00:45:37 +0900 Subject: [PATCH] Fix #2179 missing document/comment controls when counter addon is not active --- modules/admin/tpl/_dashboard_counter.html | 13 +++++++------ modules/admin/tpl/_dashboard_default.html | 13 +++++++------ modules/admin/tpl/js/dashboard_counter.js | 16 ---------------- modules/admin/tpl/js/dashboard_default.js | 13 +++++++++++++ 4 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 modules/admin/tpl/js/dashboard_default.js diff --git a/modules/admin/tpl/_dashboard_counter.html b/modules/admin/tpl/_dashboard_counter.html index 8d484c887..8aed63d55 100644 --- a/modules/admin/tpl/_dashboard_counter.html +++ b/modules/admin/tpl/_dashboard_counter.html @@ -1,4 +1,5 @@ +
@@ -33,13 +34,13 @@ {@$document = $value->variables} {$value->getTitleText()}{$lang->no_title_document} {$value->getNickName()} -
+ - - + +
  • {$lang->no_data}
  • @@ -52,13 +53,13 @@
  • {$value->getSummary()}{$lang->no_text_comment} {$value->getNickName()} -
    + - - + +
  • {$lang->no_data}
  • diff --git a/modules/admin/tpl/_dashboard_default.html b/modules/admin/tpl/_dashboard_default.html index 25754c190..42b05a0a0 100644 --- a/modules/admin/tpl/_dashboard_default.html +++ b/modules/admin/tpl/_dashboard_default.html @@ -1,4 +1,5 @@ +
    @@ -26,13 +27,13 @@ {@$document = $value->variables} {$value->getTitleText()}{$lang->no_title_document} {$value->getNickName()} -
    + - - + +
  • {$lang->no_data}
  • @@ -50,13 +51,13 @@
  • {$value->getSummary()}{$lang->no_text_comment} {$value->getNickName()} -
    + - - + +
  • {$lang->no_data}
  • diff --git a/modules/admin/tpl/js/dashboard_counter.js b/modules/admin/tpl/js/dashboard_counter.js index 44180aaee..9ce5cfc48 100644 --- a/modules/admin/tpl/js/dashboard_counter.js +++ b/modules/admin/tpl/js/dashboard_counter.js @@ -1,19 +1,3 @@ -jQuery(function($) -{ - // Dashboard portlet UI - $('.dashboard>div>section>ul>li') - .bind('mouseenter focusin', function(){ - $(this).addClass('hover').find('>.action').show(); - }) - .bind('mouseleave focusout', function() - { - if(!$(this).find(':focus').length) - { - $(this).removeClass('hover').find('>.action').hide(); - } - }); -}); - function obj2Array(htObj) { var aRes = []; diff --git a/modules/admin/tpl/js/dashboard_default.js b/modules/admin/tpl/js/dashboard_default.js new file mode 100644 index 000000000..1514d1c33 --- /dev/null +++ b/modules/admin/tpl/js/dashboard_default.js @@ -0,0 +1,13 @@ +'use strict'; + +$(function() { + var items = $('.dashboard>div>section>ul>li'); + items.on('mouseenter focusin', function() { + $(this).addClass('hover').find('>.action').show(); + }); + items.on('mouseleave focusout', function() { + if(!$(this).find(':focus').length) { + $(this).removeClass('hover').find('>.action').hide(); + } + }); +});