Merge remote-tracking branch 'origin/stable'

This commit is contained in:
zadam 2020-04-29 22:27:46 +02:00
commit 6161b1c193
7 changed files with 9 additions and 8 deletions

View File

@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.41.5",
"version": "0.41.6",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {

View File

@ -85,7 +85,7 @@ if (utils.isElectron()) {
});
}
if (params.linkURL.length !== 0 && params.mediaType === 'none') {
if (!["", "javascript:", "about:blank#blocked"].includes(params.linkURL) && params.mediaType === 'none') {
items.push({
title: `Copy link`,
uiIcon: "copy",

View File

@ -103,7 +103,7 @@ function download(url) {
url += '?' + Date.now(); // don't use cache
if (isElectron()) {
const remote = utils.dynamicRequire('electron').remote;
const remote = dynamicRequire('electron').remote;
remote.getCurrentWebContents().downloadURL(url);
}
@ -277,7 +277,7 @@ function isHtmlEmpty(html) {
async function clearBrowserCache() {
if (isElectron()) {
const win = utils.dynamicRequire('electron').remote.getCurrentWindow();
const win = dynamicRequire('electron').remote.getCurrentWindow();
await win.webContents.session.clearCache();
}
}

View File

@ -34,7 +34,8 @@ export default class CollapsibleWidget extends TabAwareWidget {
this.$bodyWrapper = this.$widget.find('.body-wrapper');
this.$bodyWrapper.attr('id', this.componentId); // for toggle to work we need id
this.widgetName = this.constructor.name;
// not using constructor name because of webpack mangling class names ...
this.widgetName = this.widgetTitle.replace(/[^[a-zA-Z0-9]/g, "_");
if (!options.is(this.widgetName + 'Collapsed')) {
this.$bodyWrapper.collapse("show");

View File

@ -15,7 +15,7 @@ import Mutex from "../services/mutex.js";
*/
export default class Component {
constructor() {
this.componentId = `comp-${this.constructor.name}-` + utils.randomString(6);
this.componentId = `comp-` + utils.randomString(8);
/** @type Component[] */
this.children = [];
this.initialized = Promise.resolve();

View File

@ -177,7 +177,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
// This function MUST be defined to enable dropping of items on the tree.
// data.hitMode is 'before', 'after', or 'over'.
const selectedBranchIds = this.getSelectedNodes().map(node => node.data.branchId);
const selectedBranchIds = this.getSelectedOrActiveNodes().map(node => node.data.branchId);
if (data.hitMode === "before") {
branchService.moveBeforeBranch(selectedBranchIds, node.data.branchId);

View File

@ -1 +1 @@
module.exports = { buildDate:"2020-04-20T22:40:02+02:00", buildRevision: "a86177bb597c752fbc96a24d4be7ab5ae6c0344d" };
module.exports = { buildDate:"2020-04-27T23:46:48+02:00", buildRevision: "0a9462241360e0baac71863af3ce7fb07cfd8c87" };