diff media/js/forums_mod.js @ 112:d1b0b86441c0

Forums: added a sync() function on the forum model. Created javascript for the moderate forum function to drive the master topic select checkbox.
author Brian Neal <bgneal@gmail.com>
date Wed, 30 Sep 2009 00:42:13 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/media/js/forums_mod.js	Wed Sep 30 00:42:13 2009 +0000
@@ -0,0 +1,15 @@
+$(document).ready(function() {
+   var master = $('#forums-master-topic');
+   var topics = $('.forums-topic_check');
+   master.click(function() {
+      var state = this.checked;
+      topics.each(function() {
+         this.checked = state;
+      });
+   });
+   topics.click(function() {
+      if (master[0].checked && !this.checked) {
+         master[0].checked = false;
+      }
+   });
+});