From d10c9a7424d1ef0aace2fd34e1008196d111a88c Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Thu, 7 Jul 2011 16:08:05 +0200 Subject: Rewrite mediamanager JavaScript Make it faster, prettier, less wrong, add UI effects, use jQuery UI Dialog, Abstract tree view stuff away into jQuery.dw_tree --- lib/scripts/subscriptions.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/scripts/subscriptions.js') diff --git a/lib/scripts/subscriptions.js b/lib/scripts/subscriptions.js index 565ea33eb..b7bffb158 100644 --- a/lib/scripts/subscriptions.js +++ b/lib/scripts/subscriptions.js @@ -21,18 +21,15 @@ jQuery(function () { $form.find("input[name='sub_target']") .click( function () { - var $input = jQuery(this); - if (!$input.prop('checked')) { + var $this = jQuery(this), show_list; + if (!$this.prop('checked')) { return; } - if ($input.val().match(/:$/)) { - $list.parent().slideDown('fast'); - } else { - $list.parent().slideUp('fast'); - if ($list.prop('checked')) { - $digest.prop('checked', 'checked'); - } + show_list = $this.val().match(/:$/); + $list.parent().dw_toggle(show_list); + if (!show_list && $list.prop('checked')) { + $digest.prop('checked', 'checked'); } } ) -- cgit v1.2.3