X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ddae51d9a0c525bfef85af0251eec14828bd1a70..e388c13ff66e64e4266cdb216eca98970c6a8651:/media/js/catalogue.js diff --git a/media/js/catalogue.js b/media/js/catalogue.js index f4c680276..bdceb1a64 100644 --- a/media/js/catalogue.js +++ b/media/js/catalogue.js @@ -14,6 +14,27 @@ $('#login-form').show(); }); + // Fragments + $('.fragment-text').each(function() { + if ($(this).prev().filter('.fragment-short-text').length) { + $(this).hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#FFF'}); } + ).click(function() { + $(this).fadeOut(function() { + $(this).prev().fadeIn() + }); + }) + } + }); + + $('.fragment-short-text').click(function() { + $(this).fadeOut(function() { $(this).next().fadeIn() }); + }).hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#FFF'}); } + ); + $('#registration-form').ajaxForm({ dataType: 'json', beforeSubmit: function() {