1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Fixed Electron upgrade regressions

This commit is contained in:
Laurent Cozic 2019-12-30 15:10:43 +01:00
parent fc67a44f95
commit 589f0803e6
9 changed files with 22 additions and 16 deletions

View File

@ -1557,9 +1557,9 @@
"dev": true "dev": true
}, },
"joplin-renderer": { "joplin-renderer": {
"version": "1.0.4", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/joplin-renderer/-/joplin-renderer-1.0.4.tgz", "resolved": "https://registry.npmjs.org/joplin-renderer/-/joplin-renderer-1.0.5.tgz",
"integrity": "sha512-Q7GoEYA6hYtv8ZQgxccn/gSw25V8kQPyWdolK0PJhG7m2BJa0zunyagtaOhMkYuWl8beDYHwTsvsVx2ayKqMcQ==", "integrity": "sha512-6WHqJdHzpxkI4AIz7/uK+V4eB+uU3kg8ut8r1HwC10kWQCMdTtH0yv04l+cNpWvQFULsZANmVr7FAP6JNhcqcw==",
"requires": { "requires": {
"base-64": "^0.1.0", "base-64": "^0.1.0",
"font-awesome-filetypes": "^2.1.0", "font-awesome-filetypes": "^2.1.0",

View File

@ -44,7 +44,7 @@
"html-minifier": "^3.5.15", "html-minifier": "^3.5.15",
"image-data-uri": "^2.0.0", "image-data-uri": "^2.0.0",
"image-type": "^3.0.0", "image-type": "^3.0.0",
"joplin-renderer": "^1.0.4", "joplin-renderer": "^1.0.5",
"joplin-turndown": "^4.0.19", "joplin-turndown": "^4.0.19",
"joplin-turndown-plugin-gfm": "^1.0.11", "joplin-turndown-plugin-gfm": "^1.0.11",
"jssha": "^2.3.0", "jssha": "^2.3.0",

View File

@ -143,6 +143,10 @@ class Bridge {
return this.electronApp().buildDir(); return this.electronApp().buildDir();
} }
screen() {
return require('electron').screen;
}
} }
let bridge_ = null; let bridge_ = null;

View File

@ -380,7 +380,9 @@ class MainScreenComponent extends React.Component {
this.styles_.verticalResizer = { this.styles_.verticalResizer = {
width: 5, width: 5,
height: rowHeight, // HACK: For unknown reasons, the resizers are just a little bit taller than the other elements,
// making the whole window scroll vertically. So we remove 10 extra pixels here.
height: rowHeight - 10,
display: 'inline-block', display: 'inline-block',
}; };

View File

@ -1,5 +1,5 @@
const React = require('react'); const React = require('react');
const electron = require('electron'); const { bridge } = require('electron').remote.require('./bridge');
class VerticalResizer extends React.PureComponent { class VerticalResizer extends React.PureComponent {
constructor() { constructor() {
@ -32,7 +32,7 @@ class VerticalResizer extends React.PureComponent {
event.dataTransfer.dropEffect = 'none'; event.dataTransfer.dropEffect = 'none';
const cursor = electron.screen.getCursorScreenPoint(); const cursor = bridge().screen().getCursorScreenPoint();
this.setState({ this.setState({
drag: { drag: {
@ -52,7 +52,7 @@ class VerticalResizer extends React.PureComponent {
// const e = event.nativeEvent; // const e = event.nativeEvent;
// if (!e.buttons || (!e.clientX && !e.clientY && !e.screenX && !e.screenY)) return; // if (!e.buttons || (!e.clientX && !e.clientY && !e.screenX && !e.screenY)) return;
const cursor = electron.screen.getCursorScreenPoint(); const cursor = bridge().screen().getCursorScreenPoint();
const newX = cursor.x; const newX = cursor.x;
const delta = newX - this.state.drag.lastX; const delta = newX - this.state.drag.lastX;
if (!delta) return; if (!delta) return;

View File

@ -4179,9 +4179,9 @@
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
}, },
"joplin-renderer": { "joplin-renderer": {
"version": "1.0.4", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/joplin-renderer/-/joplin-renderer-1.0.4.tgz", "resolved": "https://registry.npmjs.org/joplin-renderer/-/joplin-renderer-1.0.5.tgz",
"integrity": "sha512-Q7GoEYA6hYtv8ZQgxccn/gSw25V8kQPyWdolK0PJhG7m2BJa0zunyagtaOhMkYuWl8beDYHwTsvsVx2ayKqMcQ==", "integrity": "sha512-6WHqJdHzpxkI4AIz7/uK+V4eB+uU3kg8ut8r1HwC10kWQCMdTtH0yv04l+cNpWvQFULsZANmVr7FAP6JNhcqcw==",
"requires": { "requires": {
"base-64": "^0.1.0", "base-64": "^0.1.0",
"font-awesome-filetypes": "^2.1.0", "font-awesome-filetypes": "^2.1.0",

View File

@ -105,7 +105,7 @@
"html-entities": "^1.2.1", "html-entities": "^1.2.1",
"html-minifier": "^4.0.0", "html-minifier": "^4.0.0",
"image-type": "^3.0.0", "image-type": "^3.0.0",
"joplin-renderer": "^1.0.4", "joplin-renderer": "^1.0.5",
"joplin-turndown": "^4.0.19", "joplin-turndown": "^4.0.19",
"joplin-turndown-plugin-gfm": "^1.0.11", "joplin-turndown-plugin-gfm": "^1.0.11",
"jssha": "^2.3.1", "jssha": "^2.3.1",

View File

@ -3796,9 +3796,9 @@
"dev": true "dev": true
}, },
"joplin-renderer": { "joplin-renderer": {
"version": "1.0.4", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/joplin-renderer/-/joplin-renderer-1.0.4.tgz", "resolved": "https://registry.npmjs.org/joplin-renderer/-/joplin-renderer-1.0.5.tgz",
"integrity": "sha512-Q7GoEYA6hYtv8ZQgxccn/gSw25V8kQPyWdolK0PJhG7m2BJa0zunyagtaOhMkYuWl8beDYHwTsvsVx2ayKqMcQ==", "integrity": "sha512-6WHqJdHzpxkI4AIz7/uK+V4eB+uU3kg8ut8r1HwC10kWQCMdTtH0yv04l+cNpWvQFULsZANmVr7FAP6JNhcqcw==",
"requires": { "requires": {
"base-64": "^0.1.0", "base-64": "^0.1.0",
"font-awesome-filetypes": "^2.1.0", "font-awesome-filetypes": "^2.1.0",

View File

@ -19,7 +19,7 @@
"events": "^1.1.1", "events": "^1.1.1",
"form-data": "^2.1.4", "form-data": "^2.1.4",
"html-entities": "^1.2.1", "html-entities": "^1.2.1",
"joplin-renderer": "^1.0.4", "joplin-renderer": "^1.0.5",
"jsc-android": "241213.1.0", "jsc-android": "241213.1.0",
"markdown-it": "^8.4.0", "markdown-it": "^8.4.0",
"md5": "^2.2.1", "md5": "^2.2.1",