43 lines
1.0 KiB
JavaScript
43 lines
1.0 KiB
JavaScript
$(document).ready(function(){
|
|
|
|
var zIndex = 0;
|
|
$('#menu-bar').prepend($('#blog-links-manager'));
|
|
|
|
function make_draggable(elements)
|
|
{
|
|
/* Elements is a jquery object: */
|
|
elements.draggable({
|
|
snap:true,
|
|
containment:'parent',
|
|
start:function(e,ui){ ui.helper.css('z-index',++zIndex); },
|
|
stop:function(e,ui){
|
|
|
|
/* Sending the z-index and positon of the note to update_position.php via AJAX GET: */
|
|
$.get('ajax/update_position_config.php',{
|
|
x : ui.position.left,
|
|
y : ui.position.top,
|
|
id : ui.helper.attr('id')
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
//affichage des blogs
|
|
$("#blogs").html("<img src=\"images/interface/ajax_load.gif\"/> Loading Blogs...");
|
|
var tmp;
|
|
|
|
/* A helper function for converting a set of elements to draggables: */
|
|
make_draggable($('#blogs'));
|
|
|
|
$.ajax(
|
|
{url : "blogs.php",
|
|
timeout : 36000,
|
|
error: function(data){
|
|
$("#blogs").html('<img src="images/interface/error.png"/> Délai dépassé !');
|
|
},
|
|
success:function(data){
|
|
$("#blogs").html(data);
|
|
}
|
|
});
|
|
});
|