From 3d905b728919f5ee9f642d1f72a316261628b31b Mon Sep 17 00:00:00 2001 From: Eric Allen Date: Tue, 22 Sep 2009 07:37:37 -0400 Subject: [PATCH] WIP: projects page --- .../_default_context_autocomplete.rhtml | 6 -- app/views/projects/_project_form.rhtml | 10 +-- app/views/projects/_project_listing.rhtml | 11 +-- app/views/projects/_project_state_group.rhtml | 19 +---- app/views/projects/create.js.rjs | 6 +- app/views/projects/edit.js.rjs | 2 +- app/views/projects/index.html.erb | 12 +-- app/views/shared/_add_new_item_form.rhtml | 4 +- public/javascripts/application.js | 79 ++++++++++++++++--- public/javascripts/jquery-ui.js | 14 +++- 10 files changed, 97 insertions(+), 66 deletions(-) delete mode 100644 app/views/projects/_default_context_autocomplete.rhtml diff --git a/app/views/projects/_default_context_autocomplete.rhtml b/app/views/projects/_default_context_autocomplete.rhtml deleted file mode 100644 index cd92380e..00000000 --- a/app/views/projects/_default_context_autocomplete.rhtml +++ /dev/null @@ -1,6 +0,0 @@ - - \ No newline at end of file diff --git a/app/views/projects/_project_form.rhtml b/app/views/projects/_project_form.rhtml index c8926735..a2a386f5 100644 --- a/app/views/projects/_project_form.rhtml +++ b/app/views/projects/_project_form.rhtml @@ -1,7 +1,8 @@ <% project = project_form %> -<% form_tag project_path(project), { :id => dom_id(project, 'edit_form'), :class => "inline-form "+dom_id(project, 'edit_form')+"-edit-project-form", :method => :put } do -%> + +<% form_remote_tag(:url => project_path(project), :html => { :id => dom_id(project, 'edit_form'), :class => "inline-form "+dom_id(project, 'edit_form')+"-edit-project-form", :method => :put }) do -%> <%= source_view_tag( @source_view ) -%> @@ -18,7 +19,6 @@ project = project_form
<%= text_field_tag("project[default_context_name]", project.default_context.name, {:tabindex=>1,:size=> 25}) %> - <%= render :partial => 'default_context_autocomplete' %>

@@ -32,7 +32,7 @@ project = project_form <%=image_tag("accept.png", :alt => "") %> Update - + <%=image_tag("cancel.png", :alt => "") %> Cancel @@ -42,7 +42,3 @@ project = project_form <% end -%> -<%= apply_behavior "."+dom_id(project, 'edit_form')+"-edit-project-form", make_remote_form( - :before => "$('"+dom_id(project, 'submit')+"').startWaiting();", - :condition => "!$('"+dom_id(project, 'submit')+"').isWaiting()", - :external => false) %> \ No newline at end of file diff --git a/app/views/projects/_project_listing.rhtml b/app/views/projects/_project_listing.rhtml index 78a176c1..d3ff149b 100644 --- a/app/views/projects/_project_listing.rhtml +++ b/app/views/projects/_project_listing.rhtml @@ -19,20 +19,15 @@ suppress_edit_button ||= false title="delete the project '<%= project.name %>'"><%= image_tag( "blank.png", :title => "Delete project", :class=>"delete_item") %> - <%= apply_behavior "a.delete_project_button:click", { :prevent_default => true, :external => true } do |page, element| - page.confirming "'Are you sure that you want to ' + this.title + '?'" do - element.up('.project').start_waiting - page << remote_to_href(:method => 'delete') - end - end -%> + <% unless suppress_edit_button -%> <%= link_to_remote( image_tag( "blank.png", :title => "Edit project", :class=>"edit_item"), :url => {:controller => 'projects', :action => 'edit', :id => project.id}, :method => 'get', :with => "'_source_view=#{@source_view}'", - :before => "$('#{dom_id(project)}').startWaiting();", - :complete => "$('#{dom_id(project)}').stopWaiting();" + :before => "$('#{dom_id(project)}').block({message:null});", + :complete => "$('#{dom_id(project)}').unblock();" ) %> <% end -%> diff --git a/app/views/projects/_project_state_group.rhtml b/app/views/projects/_project_state_group.rhtml index 32693f0f..0b1268b0 100644 --- a/app/views/projects/_project_state_group.rhtml +++ b/app/views/projects/_project_state_group.rhtml @@ -4,28 +4,13 @@
<%= link_to("Alphabetically", alphabetize_projects_path(:state => state), :class => "alphabetize_link", :title => "Sort these projects alphabetically") %> - <% apply_behavior '.alphabetize_link:click', :prevent_default => true do |page, element| - page.confirming 'Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order.' do - page << "alphaSort = this.up('.alpha_sort'); - alphaSort.startWaiting();" - page << remote_to_href(:complete => "alphaSort.stopWaiting()") - end - end - %>
 | 
+
 | 
<%= link_to("By number of tasks", actionize_projects_path(:state => state), :class => "actionize_link", :title => "Sort these projects by number of tasks") %> - <% apply_behavior '.actionize_link:click', :prevent_default => true do |page, element| - page.confirming 'Are you sure that you want to sort these projects by the number of tasks? This will replace the existing sort order.' do - page << "tasksSort = this.up('.tasks_sort'); - tasksSort.startWaiting();" - page << remote_to_href(:complete => "tasksSort.stopWaiting()") - end - end - %>
+
<%= render :partial => 'project_listing', :collection => project_state_group %>
- <%= sortable_element "list-#{state}-projects", get_listing_sortable_options("list-#{state}-projects") %> diff --git a/app/views/projects/create.js.rjs b/app/views/projects/create.js.rjs index 86bbb49b..c51d36e9 100644 --- a/app/views/projects/create.js.rjs +++ b/app/views/projects/create.js.rjs @@ -8,10 +8,10 @@ elsif @saved page.replace_html "active-projects-count", @active_projects_count page.insert_html :bottom, "list-active-projects", :partial => 'project_listing', :locals => { :project_listing => @project } page.sortable "list-active-projects", get_listing_sortable_options('list-active-projects') - page.call "Form.reset", "project-form" - page.call "Form.focusFirstElement", "project-form" + page << "$('#project-form').clearForm();" + page << "$('#project-form input:first').focus();" else page.show 'status' page.replace_html 'status', "#{error_messages_for('project')}" end -page.hide "busy" \ No newline at end of file +page.hide "busy" diff --git a/app/views/projects/edit.js.rjs b/app/views/projects/edit.js.rjs index a1a5125c..171bd1e3 100644 --- a/app/views/projects/edit.js.rjs +++ b/app/views/projects/edit.js.rjs @@ -1,4 +1,4 @@ page[dom_id(@project, 'edit')].replace_html :partial => 'project_form', :locals => { :project_form => @project } page[@project].hide page[dom_id(@project, 'edit')].show -page[dom_id(@project, 'edit_form')].down('input.project-name').focus \ No newline at end of file +page[dom_id(@project, 'edit_form')].find('input.project-name').focus diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index a694b5ed..5a23914c 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -14,20 +14,13 @@
« Hide form - <% apply_behavior '#toggle_project_new a:click', :prevent_default => true do |page| - page << "TracksForm.toggle('toggle_project_new', 'project_new', 'project-form', - '« Hide form', 'Hide new project form', - 'Create a new project »', 'Add a project');" - end - %>
<% form_remote_tag(:url => projects_path, :method => :post, :html=> { :id=>'project-form', :name=>'project', :class => 'inline-form'}, - :before => "$('project_new_project_submit').startWaiting()", - :complete => "$('project_new_project_submit').stopWaiting()", - :condition => "!$('project_new_project_submit').isWaiting()") do -%> + :before => "$('#project_new_project_submit').block({message:null})", + :complete => "$('#project_new_project_submit').unblock()") do -%>
<%= error_messages_for('project') %>
@@ -40,7 +33,6 @@ <% unless @contexts.empty? -%>
<%= text_field_tag("project[default_context_name]", @project.default_context.name, :tabindex => 3) %> - <%= render :partial => 'default_context_autocomplete' %>
<% end -%> diff --git a/app/views/shared/_add_new_item_form.rhtml b/app/views/shared/_add_new_item_form.rhtml index 8a813eaa..99fcb4db 100644 --- a/app/views/shared/_add_new_item_form.rhtml +++ b/app/views/shared/_add_new_item_form.rhtml @@ -15,8 +15,8 @@ <% form_remote_tag( :url => todos_path, :method => :post, :html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form' }, - :before => "$('todo_new_action_submit').block({message:null})", - :complete => "$('todo_new_action_submit').unblock()", + :before => "$('#todo_new_action_submit').block({message:null})", + :complete => "$('#todo_new_action_submit').unblock()", :condition => "askIfNewContextProvided()") do -%>
<%= error_messages_for("item", :object_name => 'action') %>
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 450cac1a..74bbec13 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -22,17 +22,17 @@ var Login = { var TracksForm = { toggle: function(toggleDivId, formContainerId, formId, hideLinkText, hideLinkTitle, showLinkText, showLinkTitle) { - $(formContainerId).toggle(); - toggleDiv = $(toggleDivId); - toggleLink = toggleDiv.down('a'); - if (toggleDiv.hasClassName('hide_form')) { - toggleLink.update(showLinkText).setAttribute('title', showLinkTitle); + $('#'+formContainerId).toggle(); + toggleDiv = $('#'+toggleDivId); + toggleLink = toggleDiv.find('a'); + if (toggleDiv.hasClass('hide_form')) { + toggleLink.text(showLinkText).attr('title', showLinkTitle); } else { - toggleLink.update(hideLinkText).setAttribute('title', hideLinkTitle); - Form.focusFirstElement(formId); + toggleLink.text(hideLinkText).attr('title', hideLinkTitle); + $('#'+formId+' input:first').focus(); } - toggleDiv.toggleClassName('hide_form'); + toggleDiv.toggleClass('hide_form'); }, get_period: function() { if ($('recurring_todo_recurring_period_daily').checked) { @@ -252,11 +252,11 @@ $(document).ready(function() { $('#toggle_action_new').click(function(){ TracksForm.toggle('toggle_action_new', 'todo_new_action', 'todo-form-new-action', - '« Hide form', 'Hide next action form', - 'Add a next action »', 'Add a next action'); + '« Hide form', 'Hide next action form', + 'Add a next action »', 'Add a next action'); }); - $('.edit-form a.negative').live('click', function(){ + $('.item-container .edit-form a.negative').live('click', function(){ $(this).parents('.container').find('.item-show').show(); $(this).parents('.edit-form').hide(); }); @@ -319,4 +319,61 @@ $(document).ready(function() { }); $('#recurring_edit_'+this.id.split('_')[5]).show(); }); + + /* Projects behavior */ + $('.alphabetize_link').click(function(evt){ + evt.preventDefault(); + if(confirm('Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order.')){ + alphaSort = $(this).parents('.alpha_sort'); + alphaSort.block({message:null}); + $.post(this.href, {}, function(){alphaSort.unblock()}, 'script'); + } + }); + + $('.actionize_link').click(function(evt){ + evt.preventDefault(); + if(confirm('Are you sure that you want to sort these projects by the number of tasks? This will replace the existing sort order.')){ + taskSort = $(this).parents('.tasks_sort'); + taskSort.block({message:null}); + $.post(this.href, {}, function(){taskSort.unblock()}, 'script'); + } + }); + + $('a.delete_project_button').live('click', function(evt){ + evt.preventDefault(); + if(confirm("Are you sure that you want to "+this.title+"?")){ + $(this).parents('.project').block({message: null}); + params = {_method: 'delete'}; + $.post(this.href, params, null, 'script'); + } + }); + + $('#toggle_project_new').click(function(evt){ + TracksForm.toggle('toggle_project_new', 'project_new', 'project-form', + '« Hide form', 'Hide new project form', + 'Create a new project »', 'Add a project'); + }); + + $(".project-list .edit-form a.negative").live('click', function(evt){ + evt.preventDefault(); + $(this).parents('.list').find('.project').show(); + $(this).parents('.edit-form').hide(); + $(this).parents('.edit-form').find('form').clearForm(); + }); + + $("#list-active-projects").sortable({handle: '.handle', + /* +"#list-active-projects": function(event) { +Sortable.create("list-active-projects", {handle:'handle', onUpdate:function(){new Ajax.Request('/projects/order', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Highlight("list-active-projects",{});}, parameters:Sortable.serialize("list-active-projects") + '&authenticity_token=' + encodeURIComponent('1e046f4f2a85aa09451c6e17f902bf9a254868c6')})}, tag:'div'}) +}, +"#list-hidden-projects": function(event) { +Sortable.create("list-hidden-projects", {handle:'handle', onUpdate:function(){new Ajax.Request('/projects/order', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Highlight("list-hidden-projects",{});}, parameters:Sortable.serialize("list-hidden-projects") + '&authenticity_token=' + encodeURIComponent('1e046f4f2a85aa09451c6e17f902bf9a254868c6')})}, tag:'div'}) +}, +"#list-completed-projects": function(event) { +Sortable.create("list-completed-projects", {handle:'handle', onUpdate:function(){new Ajax.Request('/projects/order', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Highlight("list-completed-projects",{});}, parameters:Sortable.serialize("list-completed-projects") + '&authenticity_token=' + encodeURIComponent('1e046f4f2a85aa09451c6e17f902bf9a254868c6')})}, tag:'div'}) +}, + */ + update: function(event, ui){ + console.log(ui); + }}); }); diff --git a/public/javascripts/jquery-ui.js b/public/javascripts/jquery-ui.js index a4a134d2..d47d7e08 100755 --- a/public/javascripts/jquery-ui.js +++ b/public/javascripts/jquery-ui.js @@ -89,4 +89,16 @@ jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(v * Depends: * effects.core.js */ -(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;