Dotclear

Changeset 234:e5b6717225f7


Ignore:
Timestamp:
05/10/11 22:42:37 (13 years ago)
Author:
annso <as.tranchet@…>
Branch:
default
Message:

fix sticky footer and quick entry

Location:
admin/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_index.js

    r3 r234  
    44          var contentTb = new jsToolBar($('#post_content',f)[0]); 
    55          contentTb.switchMode($('#post_format',f).val()); 
    6            
     6 
    77          $('input[name=save]',f).click(function() { 
    88               quickPost(f,-2); 
    99               return false; 
    1010          }); 
    11            
     11 
    1212          if ($('input[name=save-publish]',f).length > 0) { 
    1313               var btn = $('<input type="submit" value="' + $('input[name=save-publish]',f).val() + '" tabindex="3" />'); 
     
    1919               }); 
    2020          } 
    21            
     21 
    2222          function quickPost(f,status) { 
    2323               if (contentTb.getMode() == 'wysiwyg') { 
    2424                    contentTb.syncContents('iframe'); 
    2525               } 
    26                 
     26 
    2727               var params = { 
    2828                    f: 'quickPost', 
     
    3535                    post_lang: $('#post_lang',f).val() 
    3636               } 
    37                 
     37 
    3838               $('p.qinfo',f).remove(); 
    39                 
     39 
    4040               $.post('services.php',params,function(data) { 
    4141                    if ($('rsp[status=failed]',data).length > 0) { 
     
    5757                         } 
    5858                    } 
    59                      
     59 
    6060                    $('fieldset',f).prepend(msg); 
    6161               }); 
    6262          } 
    6363     } 
    64       
     64 
    6565     // allow to hide quick entry div, and remember choice 
    6666     $('#quick h3').toggleWithLegend($('#quick').children().not('h3'),{ 
    6767          cookie: 'dcx_quick_entry', 
    68      }); 
     68     }, positionFooter); 
    6969}); 
  • admin/js/common.js

    r163 r234  
    315315     } 
    316316}; 
     317 
     318/* Sticky footer 
     319-------------------------------------------------------- */ 
     320function positionFooter() { 
     321     $("#wrapper").css({ overflow: "auto" }); 
     322     var page_height = $("#top").height() + $("#wrapper").height() - $("#footer").height(); 
     323     if( page_height < $(window).height() ){ 
     324          // calcul de la largeur 
     325          var page_width = $(document).width() - 30; 
     326          $("#footer").css({ 
     327               position: "absolute", 
     328               bottom: "10px", 
     329               width: page_width+"px", 
     330               padding: ".75em 0", 
     331               marginbottom: "0" 
     332          }); 
     333     } else { 
     334          $("#footer").css({ 
     335               position: "static", 
     336               padding: ".75em 0", 
     337               width: "auto", 
     338          }); 
     339     } 
     340 
     341} 
    317342 
    318343/* On document ready 
     
    367392     // Sticky footer 
    368393     positionFooter(); 
    369      function positionFooter() { 
    370           $("#wrapper").css({ overflow: "auto" }); 
    371           var page_height = $("#top").height() + $("#wrapper").height() - $("#footer").height(); 
    372           if( page_height < $(window).height() ){ 
    373                // calcul de la largeur 
    374                var page_width = $(document).width() - 30; 
    375                $("#footer").css({ 
    376                     position: "absolute", 
    377                     bottom: "10px", 
    378                     width: page_width+"px", 
    379                     padding: ".75em 0", 
    380                     marginbottom: "0" 
    381                }); 
    382           } else { 
    383                $("#footer").css({ 
    384                     position: "static", 
    385                     padding: ".75em 0", 
    386                     width: "auto", 
    387                }); 
    388           } 
    389  
    390      } 
    391394     $(window).resize(positionFooter); 
    392  
    393395}); 
    394396 
Note: See TracChangeset for help on using the changeset viewer.

Sites map