diff options
author | flop25 <flop25@piwigo.org> | 2013-06-16 18:20:19 +0000 |
---|---|---|
committer | flop25 <flop25@piwigo.org> | 2013-06-16 18:20:19 +0000 |
commit | 272a55d377f104a03f3fd0d2cc3c0e8c6497e57b (patch) | |
tree | c3067d44177fe2bfc619f85a4e0a17ed58172ea4 | |
parent | 2b8ea75b1d7adfbabe0f0a7303f7d0b272da3cd3 (diff) |
bug:2923
fix the bug if the panel was closed then opened
git-svn-id: http://piwigo.org/svn/trunk@23269 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | themes/elegant/scripts_pp.js | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/themes/elegant/scripts_pp.js b/themes/elegant/scripts_pp.js index bf7e1531d..b9a9352a6 100644 --- a/themes/elegant/scripts_pp.js +++ b/themes/elegant/scripts_pp.js @@ -167,23 +167,25 @@ jQuery("document").ready(function(jQuery){ comments_button.click(function() { commentsToggle() });
commentsswicther.click(function() { commentsToggle() });
-
+
+ if (jQuery('#commentAdd').is(":visible")) {
+ var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0));
+ jQuery(window).scroll(function (event) {
+ // what the y position of the scroll is
+ var y = jQuery(this).scrollTop();
+
+ // whether that's below the form
+ if (y >= top) {
+ // if so, ad the fixed class
+ jQuery('#commentAdd').addClass('fixed');
+ } else {
+ // otherwise remove it
+ jQuery('#commentAdd').removeClass('fixed');
+ }
+ });
+ }
}
- var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0));
- jQuery(window).scroll(function (event) {
- // what the y position of the scroll is
- var y = jQuery(this).scrollTop();
-
- // whether that's below the form
- if (y >= top) {
- // if so, ad the fixed class
- jQuery('#commentAdd').addClass('fixed');
- } else {
- // otherwise remove it
- jQuery('#commentAdd').removeClass('fixed');
- }
- });
});
@@ -196,6 +198,21 @@ function commentsToggle() { comments.removeClass("commentshidden").addClass("commentsshown");
comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
jQuery.cookie('comments', 'visible', {path: "/"});
+ var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0));
+ jQuery(window).scroll(function (event) {
+ // what the y position of the scroll is
+ var y = jQuery(this).scrollTop();
+
+ // whether that's below the form
+ if (y >= top) {
+ // if so, ad the fixed class
+ jQuery('#commentAdd').addClass('fixed');
+ } else {
+ // otherwise remove it
+ jQuery('#commentAdd').removeClass('fixed');
+ }
+ });
+
} else {
comments.addClass("commentshidden").removeClass("commentsshown");
comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
|