Fixing skills tree when the resizing the window (repaintAll)

skala
Julio Montoya 13 years ago
parent 1d3a977e17
commit c8f8950cc9
  1. 6
      main/inc/lib/javascript/skills.js
  2. 9
      main/template/default/skill/skill_tree.tpl

@ -251,10 +251,10 @@ function load_children(my_id, top_value, load_user_data, create_root) {
sum += $(this).outerWidth(true);
normal_weight = $(this).width();
q = $(this).css('margin-left').replace("px", "");
});
sum = sum / 2 - normal_weight/2 + q/2;
console.log('Calculating: ' + sum);
});
sum = $('body').width() / 2 - normal_weight/2 - q/2;
jsPlumb.animate('block_'+my_id, { left: sum, top:0 }, { duration: 100 });
console.log('setting animate for block_'+my_id);
//$('#block_'+my_id).css('margin-bottom', "20px");

@ -40,6 +40,8 @@ var parents = ['block_1'];
function clean_values() {
skills = []; //current window divs
parents = ['block_1'];
@ -54,6 +56,13 @@ function clean_values() {
open_block('block_1', 0, 1);
}
$(window).resize(function() {
// Top bar scroll effect
//console.log($('body').width());
jsPlumb.repaintEverything();
});
jsPlumb.ready(function() {
var loading = $( "#dialog-loading" );

Loading…
Cancel
Save