Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 50ea68f

Fixed the top nav-link calculation.

  • Participants
  • Parent commits e8aa77a

Comments (0)

Files changed (2)

File lib/Shlomif/NavMenu.pm

 
     my @coords = @{shift || $self->get_current_coords()};
 
-    if (@coords)
+    if ((! @coords) || ((@coords == 1) && ($coords[0] == 0)))
     {
-        return [];
+        return undef;
     }
     else
     {
-        return undef;
+        return [0];
     }
 }
 

File t/03nav-links.t

 
 use strict;
 
-use Test::More tests => 2;
+use Test::More tests => 3;
 
 use Shlomif::NavMenu;
 
 
     # TEST
     is($nav_links->{'up'}, "../",
-       "Up page leading upwards to the first page.")
+       "Up page leading upwards to the first page.");
+    # TEST
+    is($nav_links->{'top'}, "../",
+       "Top nav-link leading topwards to the first page.");
 }