[wellwell-devel] [wellwell/zoom] Add scope parameter for subroutines called for each element in [zoom] replacements.

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Sun Aug 15 14:59:40 UTC 2010


commit 097d1906498f0bcd9e0cd9b7acb7a42b04d3e1be
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Sun Aug 15 16:54:13 2010 +0200

    Add scope parameter for subroutines called for each element in [zoom] replacements.

 lib/WellWell/Zoom.pm |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/lib/WellWell/Zoom.pm b/lib/WellWell/Zoom.pm
index 54ef594..07366c2 100644
--- a/lib/WellWell/Zoom.pm
+++ b/lib/WellWell/Zoom.pm
@@ -194,7 +194,14 @@ sub parse_handler {
 			
 			if ($sob->{sub}) {
 				# determine code reference for named function
-				$sob->{subref} = $Vend::Cfg->{Sub}{$sob->{sub}} || $Global::GlobalSub->{$sob->{sub}};
+				my $subref = $Vend::Cfg->{Sub}{$sob->{sub}} || $Global::GlobalSub->{$sob->{sub}};
+
+				if ($sob->{scope} eq 'element') {
+					$elt->{zoom_rep_sub} = $subref;
+				}
+				else {
+					$sob->{subref} = $subref;
+				}
 			}
 			
 			$sref->{params}->{$sob->{list}}->{hash}->{$name} = $sob;



More information about the wellwell-devel mailing list