[Jifty-commit] jifty branch, master, updated. 1.10518-24-gebb2a8d
Jifty commits
jifty-commit at lists.jifty.org
Thu Jun 9 14:07:52 EDT 2011
The branch, master has been updated
via ebb2a8d21994bd8d7143f51d94dc6fdcfae6dca1 (commit)
from 2d2e5a821e89b7913782974c2818f6cfc5b67120 (commit)
Summary of changes:
lib/Jifty/Web/Menu.pm | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit ebb2a8d21994bd8d7143f51d94dc6fdcfae6dca1
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Jun 9 14:07:10 2011 -0400
Add an empty method to Jifty::Web::Menu for deleting all children
This eliminates the need to grab the kids and loop or break
encapsulation.
diff --git a/lib/Jifty/Web/Menu.pm b/lib/Jifty/Web/Menu.pm
index ac66318..366bfe0 100644
--- a/lib/Jifty/Web/Menu.pm
+++ b/lib/Jifty/Web/Menu.pm
@@ -244,6 +244,18 @@ sub delete {
delete $self->{children}{$key};
}
+=head2 empty
+
+Removes all children of this menu.
+
+=cut
+
+sub empty {
+ my $self = shift;
+ delete $self->{children_list};
+ delete $self->{children};
+}
+
=head2 children
Returns the children of this menu item in sorted order; as an array in
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list