Changeset 26086


Ignore:
Timestamp:
Dec 22, 2013, 5:31:56 PM (7 years ago)
Author:
mistic100
Message:

[elegant] fix comment form width change when scrolling caused by menubar size

Location:
trunk/themes/elegant
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/elegant/scripts_pp.js

    r26084 r26086  
    5454  function commentsToggle() {
    5555    if (comments.hasClass("commentshidden")) {
    56         comments.removeClass("commentshidden").addClass("commentsshown");
    57         comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
    58         session_storage['comments'] = 'visible';
     56      comments.removeClass("commentshidden").addClass("commentsshown");
     57      comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
     58      session_storage['comments'] = 'visible';
    5959
    60         comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
    61       }
    62       else {
    63         comments.addClass("commentshidden").removeClass("commentsshown");
    64         comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
    65         session_storage['comments'] = 'hidden';
    66       }
     60      comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0));
     61    }
     62    else {
     63      comments.addClass("commentshidden").removeClass("commentsshown");
     64      comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
     65      session_storage['comments'] = 'hidden';
     66      comments_top_offset = 0;
     67    }
    6768  }
    6869
     
    144145        if (comments_top_offset==0) return;
    145146
    146         // what the y position of the scroll is
    147147        var y = jQuery(this).scrollTop();
    148148
    149         // whether that's below the form
    150149        if (y >= comments_top_offset) {
    151           // if so, ad the fixed class
    152           comments_add.addClass('fixed');
     150          comments_add.css({
     151            'position': 'absolute',
     152            'top': y-comments.offset().top+10
     153          });
    153154        }
    154155        else {
    155           // otherwise remove it
    156           comments_add.removeClass('fixed');
     156          comments_add.css({
     157            'position': 'static',
     158            'top': 0
     159          });
    157160        }
    158161      });
  • trunk/themes/elegant/theme.css

    r24881 r26086  
    238238/* image comments */
    239239
    240 #thePicturePage #comments                       { padding: 2px 5px;}
     240#thePicturePage #comments                       { padding: 2px 5px; position:relative;}
    241241#thePicturePage #comments h3                    { margin: 10px 0;}
    242242#thePicturePage #comments form          { margin: 10px 0;}
     
    256256        font-size: 100%;
    257257}
    258 #commentAdd.fixed {  position: fixed; top: 10px; }
    259258#pictureCommentList .commentsOrder      { float: left; margin-bottom: 5px;}
    260259#pictureCommentList .navigationBar      { float: right; margin-bottom: 5px;}
Note: See TracChangeset for help on using the changeset viewer.