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