Fixed click in menu

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
pull/7051/head
John Molakvoæ (skjnldsv) 7 years ago
parent 9d3af829f2
commit 396154d7e4
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
  1. 6
      apps/files/js/breadcrumb.js
  2. 4
      apps/files/js/filelist.js

@ -113,6 +113,9 @@
* Renders the breadcrumb elements * Renders the breadcrumb elements
*/ */
render: function() { render: function() {
// Hide menu on render
OC.hideMenus();
var parts = this._makeCrumbs(this.dir || '/'); var parts = this._makeCrumbs(this.dir || '/');
var $crumb; var $crumb;
var $menuItem; var $menuItem;
@ -156,7 +159,8 @@
for (var i = 0; i < parts.length; i++) { for (var i = 0; i < parts.length; i++) {
var part = parts[i]; var part = parts[i];
if(part.dir) { if(part.dir) {
$menuItem = $('<li><a><span></span></a></li>'); $menuItem = $('<li class="crumblist"><a><span></span></a></li>');
$menuItem.data('dir', part.dir);
$menuItem.find('a').attr('href', this.getCrumbUrl(part, i)); $menuItem.find('a').attr('href', this.getCrumbUrl(part, i));
$menuItem.find('span').text(part.name); $menuItem.find('span').text(part.name);
this.$menu.children('ul').append($menuItem); this.$menu.children('ul').append($menuItem);

@ -836,8 +836,8 @@
* Event handler when clicking on a bread crumb * Event handler when clicking on a bread crumb
*/ */
_onClickBreadCrumb: function(e) { _onClickBreadCrumb: function(e) {
console.log('Clicked breadcrumb ', e); // Select a crumb or a crumb in the menu
var $el = $(e.target).closest('.crumb'), var $el = $(e.target).closest('.crumb, .crumblist'),
$targetDir = $el.data('dir'); $targetDir = $el.data('dir');
if ($targetDir !== undefined && e.which === 1) { if ($targetDir !== undefined && e.which === 1) {

Loading…
Cancel
Save