diff options
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/subscriptions.js | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/scripts/subscriptions.js b/lib/scripts/subscriptions.js index 79b1caf1a..565ea33eb 100644 --- a/lib/scripts/subscriptions.js +++ b/lib/scripts/subscriptions.js @@ -1,41 +1,41 @@ +/*jslint sloppy: true */ +/*global jQuery */ /** * Hide list subscription style if target is a page * * @author Adrian Lang <lang@cosmocode.de> * @author Pierre Spring <pierre.spring@caillou.ch> */ -(function ($) { - $(function () { - var form, list, digest; +jQuery(function () { + var $form, $list, $digest; - form = $('#subscribe__form'); + $form = jQuery('#subscribe__form'); - if (0 === form.size()) { - return; - } + if (0 === $form.length) { + return; + } - list = form.find("input[name='sub_style'][value='list']"); - digest = form.find("input[name='sub_style'][value='digest']"); + $list = $form.find("input[name='sub_style'][value='list']"); + $digest = $form.find("input[name='sub_style'][value='digest']"); - form.find("input[name='sub_target']") - .click( - function () { - var input = $(this); - if (!input.is(':checked')) { - return; - } + $form.find("input[name='sub_target']") + .click( + function () { + var $input = jQuery(this); + if (!$input.prop('checked')) { + return; + } - if (input.val().match(/:$/)) { - list.parent().show(); - } else { - list.parent().hide(); - if (list.is(':checked')) { - digest.attr('checked', 'checked'); - } + if ($input.val().match(/:$/)) { + $list.parent().slideDown('fast'); + } else { + $list.parent().slideUp('fast'); + if ($list.prop('checked')) { + $digest.prop('checked', 'checked'); } } - ) - .filter(':checked') - .click(); - }); -}(jQuery)); + } + ) + .filter(':checked') + .click(); +}); |