Commit c9f7ec03 authored by akiraohgaki's avatar akiraohgaki

Merge branch 'develop'

parents f9ae22c1 58d98bc0
Pipeline #336 passed with stage
in 1 minute and 43 seconds
......@@ -116,7 +116,9 @@ export default class WebviewComponent extends BaseComponent {
this._webview.openDevTools();
}
//this._webviewElement.send('ipc-message');
//this._webview.send('ipc-message');
this._webview.send('smooth-scroll');
});
this._webview.addEventListener('new-window', (event) => {
......@@ -133,7 +135,7 @@ export default class WebviewComponent extends BaseComponent {
}
});
//this._webviewElement.addEventListener('ipc-message', (event) => {});
//this._webview.addEventListener('ipc-message', (event) => {});
this.contentRoot.appendChild(this._webview);
}
......
/*
const {ipcRenderer} = require('electron');
ipcRenderer.on('smooth-scroll', () => {
let timeoutId = null;
let deltaX = 0;
let deltaY = 0;
const amount = 2;
document.scrollingElement.addEventListener('wheel', (event) => {
event.preventDefault();
deltaX += event.deltaX * amount;
deltaY += event.deltaY * amount;
if (timeoutId === null) {
timeoutId = setTimeout(() => {
document.scrollingElement.scrollBy({
left: deltaX,
top: deltaY,
behavior: 'smooth'
});
timeoutId = null;
deltaX = 0;
deltaY = 0;
}, 150);
}
});
});
/*
ipcRenderer.on('user-profile', () => {
const profileMenu = document.querySelector('[rel="profile-menu"]');
if (profileMenu) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment