diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-11-07 05:40:26 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-11-08 13:04:39 +0100 |
commit | 9d3af829f2cdee369aee93250f330b50e57f2505 (patch) | |
tree | 2cd7e874f58d56450a7657318222d091b8b66065 /apps/files/js | |
parent | 33bac270db6977dd65ef02e8bb8b1d75bbefcbbd (diff) | |
download | nextcloud-server-9d3af829f2cdee369aee93250f330b50e57f2505.tar.gz nextcloud-server-9d3af829f2cdee369aee93250f330b50e57f2505.zip |
Fixed breadcrumb action feedback and optimisation
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/breadcrumb.js | 14 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index e44da02fe53..f087a76a046 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -33,7 +33,7 @@ */ var BreadCrumb = function(options){ this.$el = $('<div class="breadcrumb"></div>'); - this.$menu = $('<div class="popovermenu menu menu-center"><ul></ul></div>'); + this.$menu = $('<div class="popovermenu menu-center"><ul></ul></div>'); options = options || {}; if (options.onClick) { this.onClick = options.onClick; @@ -84,6 +84,7 @@ }, setDirectoryInfo: function(dirInfo) { + console.log(dirInfo); if (dirInfo !== this.dirInfo) { this.dirInfo = dirInfo; this.render(); @@ -144,13 +145,12 @@ } this.breadcrumbs.push($crumb); this.$el.append($crumb); - if (this.onClick) { - $crumb.on('click', this.onClick); + // Only add feedback if not menu + if (this.onClick && i !== 0) { + $link.on('click', this.onClick); } } - var err = new Error(); - console.log(err.stack); // Menu creation this._createMenu(); for (var i = 0; i < parts.length; i++) { @@ -165,7 +165,6 @@ } } } - _.each(this._detailViews, function(view) { view.render({ dirInfo: this.dirInfo @@ -188,7 +187,8 @@ hoverClass: 'canDrop' }); } - + // Menu is destroyed on every change, we need to init it + OC.registerMenu($('.crumbmenu'), $('.crumbmenu > .popovermenu')); this._resize(); }, diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 0fdec811a34..e69fec9b0c8 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -836,11 +836,13 @@ * Event handler when clicking on a bread crumb */ _onClickBreadCrumb: function(e) { + console.log('Clicked breadcrumb ', e); var $el = $(e.target).closest('.crumb'), $targetDir = $el.data('dir'); if ($targetDir !== undefined && e.which === 1) { e.preventDefault(); + console.log('Triggered dir change'); this.changeDirectory($targetDir, true, true); this.updateSearch(); } |