From: Vincent Petry Date: Sun, 1 Sep 2013 12:24:01 +0000 (+0200) Subject: Changed breadcrumb event handling to not use delegate X-Git-Tag: v6.0.0alpha2~179^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3cf0820d3507349fa2d518c24579d8605db7cd2e;p=nextcloud-server.git Changed breadcrumb event handling to not use delegate Using delegate might break apps that embed themselves in the files container. When an app embeds itself and the user clicks a breadcrumb, it will simply reload the whole browser page. --- diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 1ea2f5fbcc2..7aef8ea1d11 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -131,10 +131,12 @@ Files={ Files.breadcrumbsWidth += $(breadcrumb).get(0).offsetWidth; }); - $.each($('#controls .actions>div'), function(index, action) { Files.breadcrumbsWidth += $(action).get(0).offsetWidth; }); + + // event handlers for breadcrumb items + $('#controls .crumb a').on('click', onClickBreadcrumb); }, resizeBreadcrumbs: function (width, firstRun) { @@ -349,9 +351,6 @@ $(document).ready(function() { var width = $(this).width(); Files.resizeBreadcrumbs(width, true); - // event handlers for breadcrumb items - $('#controls').delegate('.crumb a', 'click', onClickBreadcrumb); - // display storage warnings setTimeout ( "Files.displayStorageWarnings()", 100 ); OC.Notification.setDefault(Files.displayStorageWarnings);