]> source.dussan.org Git - nextcloud-server.git/commitdiff
Changed breadcrumb event handling to not use delegate
authorVincent Petry <pvince81@owncloud.com>
Sun, 1 Sep 2013 12:24:01 +0000 (14:24 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 13 Sep 2013 17:59:15 +0000 (19:59 +0200)
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.

apps/files/js/files.js

index 1ea2f5fbcc276681aba39fee433ca4f7eda48855..7aef8ea1d114a44a8520a6221b3cfca21e9fe867 100644 (file)
@@ -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);