mirror of
https://github.com/Piwigo/piwigo-elegant.git
synced 2026-03-28 17:43:07 +01:00
[elegant] fix comment form width change when scrolling caused by menubar size
git-svn-id: http://piwigo.org/svn/trunk@26086 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -53,17 +53,18 @@
|
||||
|
||||
function commentsToggle() {
|
||||
if (comments.hasClass("commentshidden")) {
|
||||
comments.removeClass("commentshidden").addClass("commentsshown");
|
||||
comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
|
||||
session_storage['comments'] = 'visible';
|
||||
comments.removeClass("commentshidden").addClass("commentsshown");
|
||||
comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
|
||||
session_storage['comments'] = 'visible';
|
||||
|
||||
comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
|
||||
}
|
||||
else {
|
||||
comments.addClass("commentshidden").removeClass("commentsshown");
|
||||
comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
|
||||
session_storage['comments'] = 'hidden';
|
||||
}
|
||||
comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
|
||||
}
|
||||
else {
|
||||
comments.addClass("commentshidden").removeClass("commentsshown");
|
||||
comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
|
||||
session_storage['comments'] = 'hidden';
|
||||
comments_top_offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(function(){
|
||||
@@ -143,17 +144,19 @@
|
||||
jQuery(window).scroll(function (event) {
|
||||
if (comments_top_offset==0) return;
|
||||
|
||||
// what the y position of the scroll is
|
||||
var y = jQuery(this).scrollTop();
|
||||
|
||||
// whether that's below the form
|
||||
if (y >= comments_top_offset) {
|
||||
// if so, ad the fixed class
|
||||
comments_add.addClass('fixed');
|
||||
comments_add.css({
|
||||
'position': 'absolute',
|
||||
'top': y-comments.offset().top+10
|
||||
});
|
||||
}
|
||||
else {
|
||||
// otherwise remove it
|
||||
comments_add.removeClass('fixed');
|
||||
comments_add.css({
|
||||
'position': 'static',
|
||||
'top': 0
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ a:hover { border-bottom: none;}
|
||||
|
||||
/* image comments */
|
||||
|
||||
#thePicturePage #comments { padding: 2px 5px;}
|
||||
#thePicturePage #comments { padding: 2px 5px; position:relative;}
|
||||
#thePicturePage #comments h3 { margin: 10px 0;}
|
||||
#thePicturePage #comments form { margin: 10px 0;}
|
||||
#thePicturePage #comments fieldset { margin: 0 1em;}
|
||||
@@ -255,7 +255,6 @@ a:hover { border-bottom: none;}
|
||||
font-family: Arial,Helvetica,sans-serif;
|
||||
font-size: 100%;
|
||||
}
|
||||
#commentAdd.fixed { position: fixed; top: 10px; }
|
||||
#pictureCommentList .commentsOrder { float: left; margin-bottom: 5px;}
|
||||
#pictureCommentList .navigationBar { float: right; margin-bottom: 5px;}
|
||||
#pictureComments h4 { margin: 0;}
|
||||
|
||||
Reference in New Issue
Block a user