Merge pull request #5165 from owncloud/files-dropontobreadcrumbfix

Fix breadcrumb to reinit dnd after ajax nav #5064
This commit is contained in:
Morris Jobke 2013-10-07 05:01:02 -07:00
commit 193e815133

View file

@ -98,6 +98,8 @@ Files={
lastWidth: 0, lastWidth: 0,
initBreadCrumbs: function () { initBreadCrumbs: function () {
var $controls = $('#controls');
Files.lastWidth = 0; Files.lastWidth = 0;
Files.breadcrumbs = []; Files.breadcrumbs = [];
@ -118,7 +120,10 @@ Files={
}); });
// event handlers for breadcrumb items // event handlers for breadcrumb items
$('#controls .crumb a').on('click', onClickBreadcrumb); $controls.find('.crumb a').on('click', onClickBreadcrumb);
// setup drag and drop
$controls.find('.crumb:not(.last)').droppable(crumbDropOptions);
}, },
resizeBreadcrumbs: function (width, firstRun) { resizeBreadcrumbs: function (width, firstRun) {
@ -176,11 +181,8 @@ $(document).ready(function() {
$('#file_action_panel').attr('activeAction', false); $('#file_action_panel').attr('activeAction', false);
$('div.crumb:not(.last)').droppable(crumbDropOptions); // allow dropping on the "files" app icon
$('ul#apps>li:first-child').data('dir',''); $('ul#apps li:first-child').data('dir','').droppable(crumbDropOptions);
if($('div.crumb').length){
$('ul#apps>li:first-child').droppable(crumbDropOptions);
}
// Triggers invisible file input // Triggers invisible file input
$('#upload a').on('click', function() { $('#upload a').on('click', function() {