javascript update

This commit is contained in:
devin 2012-04-20 07:31:48 +08:00
parent 19750d69e0
commit 1f077cf2b3
1 changed files with 11 additions and 7 deletions

View File

@ -371,15 +371,18 @@ var orbitDesktop = function(dom){
});
$("div#sections .section_label li:not(:nth-child(1))").droppable({
drop:function(event, ui){
element = ui.draggable;
elementParent = ui.draggable.parent();
if($("#"+$(this).data("category")+" .element").length>=24){
elementParent = ui.draggable.parents('.group');
var $item = $( this ),
$list = $( '#'+$item.data("category") );
if($list.children('.element').length>=24){
o.notify("Section is full.","alert");
}
else{
element.appendTo('body');
// .appendTo("#"+$(this).data("category"));
$.post("/desktop/save_desktop_settings",{"save":"appnewsection","appid":element.attr("id"),"newsectionid":$(this).data("content"),"desktopid":o.desktopId})
ui.draggable.hide('fast',function(){
$(this).appendTo($list).fadeIn();
});
$.post("/desktop/save_desktop_settings",{"save":"appnewsection","appid":ui.draggable.attr("id"),"newsectionid":$(this).data("content"),"desktopid":o.desktopId});
if(o.sectionId == $(this).data("content") || o.sectionId == elementParent.attr("id")){
o.desktopData["home"]="";
}
@ -390,7 +393,8 @@ var orbitDesktop = function(dom){
},
out:function(){
$(this).find('span.tile').addClass('op06');
}
},
accept: '.to_drop'
});
$('.tinycanvas')
.tinyscrollbar({ axis: 'x'})