mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Merge branch 'develop' into features/datetime-picker
This commit is contained in:
commit
c7cd435e95
|
@ -76,7 +76,7 @@ RUN \
|
||||||
librsvg2-2 \
|
librsvg2-2 \
|
||||||
libvips42 \
|
libvips42 \
|
||||||
graphviz \
|
graphviz \
|
||||||
chromium-driver \
|
chromium \
|
||||||
libfile-mimeinfo-perl && \
|
libfile-mimeinfo-perl && \
|
||||||
npm install -g yarn && \
|
npm install -g yarn && \
|
||||||
yarn add puppeteer@npm:puppeteer-core && \
|
yarn add puppeteer@npm:puppeteer-core && \
|
||||||
|
|
|
@ -609,9 +609,11 @@ var ExperimnetTable = {
|
||||||
|
|
||||||
$.get(dataUrl, tableParams, (result) => {
|
$.get(dataUrl, tableParams, (result) => {
|
||||||
$(this.table).find('.table-row-placeholder, .table-row-placeholder-divider').remove();
|
$(this.table).find('.table-row-placeholder, .table-row-placeholder-divider').remove();
|
||||||
|
setTimeout(() => {
|
||||||
this.appendRows(result.data);
|
this.appendRows(result.data);
|
||||||
this.initDueDatePicker(result.data);
|
this.initDueDatePicker(result.data);
|
||||||
this.handleNoResults();
|
this.handleNoResults();
|
||||||
|
}, 100);
|
||||||
|
|
||||||
InfiniteScroll.init(this.table, {
|
InfiniteScroll.init(this.table, {
|
||||||
url: dataUrl,
|
url: dataUrl,
|
||||||
|
@ -621,9 +623,11 @@ var ExperimnetTable = {
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
lastPage: !result.next_page,
|
lastPage: !result.next_page,
|
||||||
customResponse: (response) => {
|
customResponse: (response) => {
|
||||||
|
setTimeout(() => {
|
||||||
this.appendRows(response.data);
|
this.appendRows(response.data);
|
||||||
this.initDueDatePicker(response.data);
|
this.initDueDatePicker(response.data);
|
||||||
this.initProvisioningStatusPolling();
|
this.initProvisioningStatusPolling();
|
||||||
|
}, 100);
|
||||||
},
|
},
|
||||||
customParams: (params) => {
|
customParams: (params) => {
|
||||||
return { ...params, ...tableParams };
|
return { ...params, ...tableParams };
|
||||||
|
|
|
@ -263,6 +263,7 @@ var MarvinJsEditorApi = (function() {
|
||||||
} else if (config.mode === 'edit') {
|
} else if (config.mode === 'edit') {
|
||||||
config.objectType = 'Asset';
|
config.objectType = 'Asset';
|
||||||
MarvinJsEditor.update(config);
|
MarvinJsEditor.update(config);
|
||||||
|
location.reload();
|
||||||
} else if (config.mode === 'new-tinymce') {
|
} else if (config.mode === 'new-tinymce') {
|
||||||
config.objectType = 'TinyMceAsset';
|
config.objectType = 'TinyMceAsset';
|
||||||
MarvinJsEditor.save(config);
|
MarvinJsEditor.save(config);
|
||||||
|
|
|
@ -83,32 +83,49 @@ export default {
|
||||||
|
|
||||||
const editorHeader = $('.tox-editor-header');
|
const editorHeader = $('.tox-editor-header');
|
||||||
|
|
||||||
// For Protocol Templates only reset the left value
|
// For Protocol Templates
|
||||||
if (!this.headerRef && !this.secondaryNavigation) {
|
if (!this.headerRef && !this.secondaryNavigation) {
|
||||||
|
if (target[0].getBoundingClientRect().top < 0 && editorHeader.css('position') !== 'fixed') {
|
||||||
|
$('html, body').animate({
|
||||||
|
scrollTop: target.offset().top - editorHeader.outerHeight(),
|
||||||
|
}, 100); // 100ms works best for editorHeader to be fully visible
|
||||||
|
} else {
|
||||||
editorHeader.css('left', '');
|
editorHeader.css('left', '');
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle opening TinyMCE toolbars when only a small bottom area of editor is visible
|
// Handle opening TinyMCE toolbars when only a small bottom area of editor is visible
|
||||||
const targetBottom = target[0].getBoundingClientRect().bottom;
|
const targetBottom = target[0].getBoundingClientRect().bottom;
|
||||||
if (targetBottom < 3 * headerHeight) {
|
if (targetBottom < 3 * headerHeight) {
|
||||||
$('html, body').animate({
|
this.$nextTick(() => {
|
||||||
scrollTop: target.offset().top,
|
|
||||||
}, 800);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle showing TinyMCE toolbar for fixed/static position of toolbar
|
|
||||||
if (editorHeader.css('position') === 'fixed') {
|
if (editorHeader.css('position') === 'fixed') {
|
||||||
editorHeader.css({
|
editorHeader.css({
|
||||||
top: totalHeight - 1,
|
top: totalHeight - 1,
|
||||||
left: '',
|
left: '',
|
||||||
});
|
});
|
||||||
} else if (headerTop < (visibleHeaderHeight + visibleSecondaryNavHeight)
|
}
|
||||||
&& target[0].getBoundingClientRect().top <= headerTop) {
|
|
||||||
$('html, body').animate({
|
$('html, body').animate({
|
||||||
scrollTop: editorHeader.offset().top
|
scrollTop: target.offset().top + (visibleHeaderHeight + visibleSecondaryNavHeight),
|
||||||
}, 800);
|
}, 100);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerBottom = this.headerRef.getBoundingClientRect().bottom;
|
||||||
|
// Handle showing TinyMCE toolbar for fixed/static position of toolbar
|
||||||
|
if (editorHeader.css('position') === 'fixed') {
|
||||||
|
editorHeader.css('left', '');
|
||||||
|
if (this.headerSticked) {
|
||||||
|
editorHeader.css('top', totalHeight - 1);
|
||||||
|
}
|
||||||
|
} else if (headerTop < (visibleHeaderHeight + visibleSecondaryNavHeight)
|
||||||
|
&& target[0].getBoundingClientRect().top <= headerBottom) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
$('html, body').animate({
|
||||||
|
scrollTop: target.offset().top + (visibleHeaderHeight + visibleSecondaryNavHeight),
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
target.focus();
|
target.focus();
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
@resizing="onResizeMove"
|
@resizing="onResizeMove"
|
||||||
@resize-end="onResizeEnd"
|
@resize-end="onResizeEnd"
|
||||||
>
|
>
|
||||||
<div class="ml-4 h-full border rounded relative bg-sn-white flex flex-col right-0 absolute navigator-container">
|
<div class="ml-4 h-full border rounded bg-sn-white flex flex-col right-0 absolute navigator-container">
|
||||||
<div class="px-3 py-2.5 flex items-center relative leading-4">
|
<div class="px-3 py-2.5 flex items-center relative leading-4">
|
||||||
<i class="sn-icon sn-icon-navigator"></i>
|
<i class="sn-icon sn-icon-navigator"></i>
|
||||||
<div class="font-bold text-base pl-3">
|
<div class="font-bold text-base pl-3">
|
||||||
|
|
|
@ -197,7 +197,7 @@ class TeamZipExportJob < ZipExportJob
|
||||||
else
|
else
|
||||||
return unless preview.processed?
|
return unless preview.processed?
|
||||||
|
|
||||||
file_name = preview.filename.to_s
|
file_name = preview.blob.filename.to_s
|
||||||
file_data = preview.download
|
file_data = preview.download
|
||||||
end
|
end
|
||||||
rescue ActiveStorage::FileNotFoundError => e
|
rescue ActiveStorage::FileNotFoundError => e
|
||||||
|
|
2
bin/chromium
Executable file
2
bin/chromium
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
env -i /usr/bin/chromium $@
|
|
@ -3,7 +3,7 @@
|
||||||
Grover.configure do |config|
|
Grover.configure do |config|
|
||||||
config.options = {
|
config.options = {
|
||||||
cache: false,
|
cache: false,
|
||||||
executable_path: '/usr/bin/chromium',
|
executable_path: './bin/chromium',
|
||||||
launch_args: ['--no-sandbox']
|
launch_args: ['--no-sandbox']
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue