about summary refs log tree commit diff
path: root/laravel/resources/js
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2019-04-12 23:35:42 -0400
committerZach DeCook <zachdecook@gmail.com>2019-04-12 23:35:42 -0400
commitd9e242367c82be311cfe11ed26be6c70cbd9b510 (patch)
tree34f76da7755b2686414c8a04554495a8413b1e85 /laravel/resources/js
parentaac6e6c9cf8da931ceb3ddd9a05bd6187336f64c (diff)
downloadprosongsa-d9e242367c82be311cfe11ed26be6c70cbd9b510.tar.gz
* JS: Start moving over
Diffstat (limited to 'laravel/resources/js')
-rw-r--r--laravel/resources/js/toc-filter.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/laravel/resources/js/toc-filter.js b/laravel/resources/js/toc-filter.js
new file mode 100644
index 0000000..08afa2d
--- /dev/null
+++ b/laravel/resources/js/toc-filter.js
@@ -0,0 +1,18 @@
+$(function(){
+	$("#toc-filter").bind("change paste keyup", toc_filter);
+});
+
+function toc_filter( event )
+{
+	var val = $(this).val().toLowerCase();
+	$("#toc li").each(function(){
+		if($(this).text().toLowerCase().indexOf(val) == -1)
+		{
+			$(this).hide();
+		}
+		else
+		{
+			$(this).show();
+		}
+	});
+}
\ No newline at end of file