[Rt-commit] rt branch, 5.0/remove-empty-dropdown-in-history-header, created. rt-5.0.0alpha1-118-g91b1edfcfc

? sunnavy sunnavy at bestpractical.com
Fri Apr 24 16:42:05 EDT 2020


The branch, 5.0/remove-empty-dropdown-in-history-header has been created
        at  91b1edfcfcd0e993995703bf02aaf4cc26bd4657 (commit)

- Log -----------------------------------------------------------------
commit 91b1edfcfcd0e993995703bf02aaf4cc26bd4657
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 25 04:28:15 2020 +0800

    No need to show an empty dropdown in history header

diff --git a/share/html/Elements/ShowHistoryHeader b/share/html/Elements/ShowHistoryHeader
index 2edd738761..600426a5c0 100644
--- a/share/html/Elements/ShowHistoryHeader
+++ b/share/html/Elements/ShowHistoryHeader
@@ -114,16 +114,19 @@ if ( $ShowDisplayModes or $ShowTitle or $ScrollShowHistory ) {
                          qq{</a>} );
     }
 
-    # build the new link
-    my $alt = loc('Edit');
-    my $titleright = qq{<div class="btn-group dropdown"><a id="history-dropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span></a><ul class="dropdown-menu dropdown-menu-right">};
+    my $titleright;
+    if ( @elements ) {
+        # build the new link
+        my $alt = loc('Edit');
+        $titleright = qq{<div class="btn-group dropdown"><a id="history-dropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span></a><ul class="dropdown-menu dropdown-menu-right">};
 
-    # foreach of the elements, build a new <li>$element</li> and append to the output.
-    foreach my $element ( @elements ) {
-        $titleright .= qq{<li class="dropdown-item">$element</li>};
-    }
+        # foreach of the elements, build a new <li>$element</li> and append to the output.
+        foreach my $element ( @elements ) {
+            $titleright .= qq{<li class="dropdown-item">$element</li>};
+        }
 
-    $titleright .= q{</ul></div>};
+        $titleright .= q{</ul></div>};
+    }
 
 </%perl>
 % $m->callback( CallbackName => 'BeforeTitle', %ARGS, title => \$title, titleright => \$titleright );

-----------------------------------------------------------------------


More information about the rt-commit mailing list