summaryrefslogtreecommitdiff
path: root/httemplate/elements/onload.js
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-08-20 16:28:29 -0700
committerMark Wells <mark@freeside.biz>2013-08-20 16:28:29 -0700
commit5a3704ecdaa3a5a78e8a46dffcbeb86a6f1148d4 (patch)
tree5d5a093d0a3229730caaa781471008c36215d5f9 /httemplate/elements/onload.js
parentaa8d83861d725a1566375c15382780930f08fedd (diff)
future package change: adjust behavior of date field, #20687
Diffstat (limited to 'httemplate/elements/onload.js')
-rw-r--r--httemplate/elements/onload.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/httemplate/elements/onload.js b/httemplate/elements/onload.js
new file mode 100644
index 000000000..bfa7eef94
--- /dev/null
+++ b/httemplate/elements/onload.js
@@ -0,0 +1,22 @@
+<%doc>
+Filter component to attach a window.onload handler.
+
+Usage:
+ <script>
+ <&| elements/onload.js &>
+ if ( the_stars_are_right ) {
+ run_this_function();
+ }
+ </&>
+ </script>
+
+</%doc>
+(function() {
+ var tmp = window.onload;
+ window.onload = function() {
+ if (typeof(tmp)== 'function') {
+ tmp();
+ }
+<% $m->content %>
+ };
+})();