Fixed click in menu

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-11-07 05:53:17 +01:00
parent 9d3af829f2
commit 396154d7e4
No known key found for this signature in database
GPG key ID: FB5ACEED51955BF8
2 changed files with 7 additions and 3 deletions

View file

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

View file

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