From e5e7238d0f83789217950441aefb4c70e47eac1c Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Sun, 4 Mar 2012 20:43:05 -0800 Subject: Pulls river js out into external file --- js/lib/ui.river.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 js/lib/ui.river.js (limited to 'js') diff --git a/js/lib/ui.river.js b/js/lib/ui.river.js new file mode 100644 index 000000000..a56a664a4 --- /dev/null +++ b/js/lib/ui.river.js @@ -0,0 +1,14 @@ +elgg.provide('elgg.ui.river'); + +elgg.ui.river.init = function() { + $('#elgg-river-selector').change(function() { + var url = window.location.href; + if (window.location.search.length) { + url = url.substring(0, url.indexOf('?')); + } + url += '?' + $(this).val(); + elgg.forward(url); + }); +}; + +elgg.register_hook_handler('init', 'system', elgg.ui.river.init); \ No newline at end of file -- cgit v1.2.3