Revision 34bde82d

b/ui/static/synnefo.js
264 264
        $('#networks-pane div.confirm_multiple span.actionLen').text(pending_actions.length);
265 265
        $('#networks-pane div.confirm_multiple').show();
266 266
    }
267

  
268
    try {
269
        update_network_confirmations_position();
270
    } catch (err) { console.error(err) };
267 271
}
268 272

  
269 273
function list_view() {
b/ui/templates/machines_icon.html
276 276
        $(this).find('.info-label').addClass('darker');
277 277
        $(this).parent().parent().addClass('light-background');
278 278
    }
279
    $(this).parent().parent().find(".info-content").slideToggle(600);
279

  
280
    // toggling resizes the main content, check the confirmations box position
281
    $(this).parent().parent().find(".info-content").slideToggle(600, update_confirmations_position);
280 282
    return false;
281 283
});
282 284

  
......
773 775
    } else {
774 776
        hideWelcome();
775 777
    }
778

  
776 779
    // set confirm box position
777
    if (window.innerHeight - CONFIRMBOX_OFFSET < $('#machinesview-icon.standard').height()) {
780
    update_confirmations_position();
781
    update_transition_names();
782
}
783

  
784
function update_confirmations_position() {
785
    // ie fix
786
    var height = window.innerHeight || window.document.body.clientHeight;
787
    if (height - CONFIRMBOX_OFFSET < $('#machinesview-icon').height()) {
778 788
        $('.confirm_multiple').addClass('fixed');
779 789
    } else {
780 790
        $('.confirm_multiple').removeClass('fixed');
781 791
    }
782

  
783
    update_transition_names();
784 792
}
785 793

  
786 794
// reposition multiple confirmation box on window resize
787 795
$(window).resize(function(){
788
    if (this.innerHeight - CONFIRMBOX_OFFSET < $('#machinesview-icon').height())
789
        $('.confirm_multiple').addClass('fixed');
790
    else
791
        $('.confirm_multiple').removeClass('fixed');
796
    update_confirmations_position();
792 797
});
793 798

  
794 799
// update metadata list
......
846 851

  
847 852
// handle update stats
848 853
function update_server_stats() {
849
    // TODO: only reload images for expanded machines
854
// TODO: only reload images for expanded machines
850 855
    $(".vm-stats").each(function(){
851 856
        var serverID = $(this).closest(".machine-container").attr("id");
852 857
        get_server_stats(serverID);
b/ui/templates/networks.html
1211 1211
    //remove top margin from the first machine of each private network
1212 1212
    $(".private-networks").find(".network-contents .network-machine:first-child").css("margin-top","0");
1213 1213

  
1214
    // if some network block got resized confirmation box could have been moved 
1215
    // out of the bottom of the page, fix its position to static if needed
1216
    update_network_confirmations_position();
1214 1217
}
1215 1218

  
1216 1219
// indicate that the requested action was not completed
......
1222 1225
    $('#networks-container #net-'+networkID+ ' .action_error').show();
1223 1226
}
1224 1227

  
1225
// reposition multiple confirmation box on window resize
1226
$(window).resize(function(){
1228
function update_network_confirmations_position() {
1227 1229
    if (this.innerHeight - 220 < $('#networks-pane #networks-container').height()) {
1228 1230
        $('#networks-pane .confirm_multiple').addClass('fixed');
1229 1231
        $('div.reboot-dialog').addClass('fixed');
......
1231 1233
        $('#networks-pane .confirm_multiple').removeClass('fixed');
1232 1234
        $('div.reboot-dialog').removeClass('fixed');
1233 1235
    }
1236
}
1237
// reposition multiple confirmation box on window resize
1238
$(window).resize(function(){
1239
    update_network_confirmations_position();
1234 1240
});
1235 1241

  
1236 1242
// basic functions executed on page load

Also available in: Unified diff