single snapshot test
This commit is contained in:
19
plugins/owncloud-attach/ui/toolbar.js
Normal file
19
plugins/owncloud-attach/ui/toolbar.js
Normal file
@@ -0,0 +1,19 @@
|
||||
(function(){
|
||||
const runtime = window.MAILCOW_PLUGIN_RUNTIME;
|
||||
if (!runtime) return;
|
||||
runtime.registerMount('owncloud-attach','mail.compose.toolbar','toolbar-button', async (target, context) => {
|
||||
target.innerHTML = '';
|
||||
const button = document.createElement('button');
|
||||
button.className = 'owncloud-attach-button';
|
||||
button.textContent = context.contribution.label || 'ownCloud';
|
||||
button.addEventListener('click', async () => {
|
||||
const panelTarget = document.querySelector('[data-plugin-target="owncloud-attach:mail.compose.attachments:attachments-panel"]');
|
||||
if (panelTarget) {
|
||||
panelTarget.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
panelTarget.classList.add('owncloud-flash');
|
||||
setTimeout(() => panelTarget.classList.remove('owncloud-flash'), 1200);
|
||||
}
|
||||
});
|
||||
target.appendChild(button);
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user