mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
very rough clickable breadcrumbs
This commit is contained in:
parent
d7c1c4bc4c
commit
e14f505529
@ -142,7 +142,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="breadcrumb">
|
<div class="breadcrumb">
|
||||||
<template is="dom-repeat" items="{{breadcrumbs}}">
|
<template is="dom-repeat" items="{{breadcrumbs}}">
|
||||||
<div class="folder-breadcrumb-container">
|
<div on-click="goToFolderBreadcrumbs" data-name="[[item]]" class="folder-breadcrumb-container">
|
||||||
<img class="folder-breadcrumb-img" src="img/folder.svg">
|
<img class="folder-breadcrumb-img" src="img/folder.svg">
|
||||||
|
|
||||||
<div class="folder-breadcrumb-text">[[item]]</div>
|
<div class="folder-breadcrumb-text">[[item]]</div>
|
||||||
@ -222,12 +222,14 @@
|
|||||||
var relativePath = this.container + path + event.model.item.fileName;
|
var relativePath = this.container + path + event.model.item.fileName;
|
||||||
var slug = event.model.item.location.site + '/' + relativePath;
|
var slug = event.model.item.location.site + '/' + relativePath;
|
||||||
this.breadcrumbs = relativePath.split('/');
|
this.breadcrumbs = relativePath.split('/');
|
||||||
console.log('event.model.item.location.path' + event.model.item.location.path);
|
this.fetchFolderFolder(slug);
|
||||||
console.log('event.model.item.fileName' + event.model.item.fileName);
|
},
|
||||||
console.log('event.model.item.location.site' + event.model.item.location.site);
|
|
||||||
|
|
||||||
console.log('relativePath' + relativePath);
|
goToFolderBreadcrumbs: function (event) {
|
||||||
console.log('this.breadcrumbs' + this.breadcrumbs);
|
var currentRelative = event.model.__data__.item;
|
||||||
|
var currentRelativeIndexInSlug = this.lastSlug.indexOf(currentRelative);
|
||||||
|
var slug = this.lastSlug.substr(0, currentRelativeIndexInSlug + currentRelative.length);
|
||||||
|
this.breadcrumbs = slug.substr(6,slug.length).split('/');
|
||||||
this.fetchFolderFolder(slug);
|
this.fetchFolderFolder(slug);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -237,7 +239,7 @@
|
|||||||
this.fetchFolderFolder(initialFolder);
|
this.fetchFolderFolder(initialFolder);
|
||||||
var self = this;
|
var self = this;
|
||||||
if(document.querySelector("#alfresco-app")) {
|
if(document.querySelector("#alfresco-app")) {
|
||||||
document.querySelector("#alfresco-app").uploadedSignal = function (e, detail, sender) {
|
document.querySelector("#alfresco-app").uploadedSignal = function () {
|
||||||
self.fetchFolderFolder(initialFolder);
|
self.fetchFolderFolder(initialFolder);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -254,6 +256,7 @@
|
|||||||
|
|
||||||
xhr.addEventListener("error", error);
|
xhr.addEventListener("error", error);
|
||||||
|
|
||||||
|
this.lastSlug = slug;
|
||||||
xhr.open("GET", (this.baseUrl() + slug));
|
xhr.open("GET", (this.baseUrl() + slug));
|
||||||
xhr.withCredentials = true;
|
xhr.withCredentials = true;
|
||||||
xhr.setRequestHeader("Authorization", 'Basic ' + btoa('admin:admin'));
|
xhr.setRequestHeader("Authorization", 'Basic ' + btoa('admin:admin'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user