mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-02 21:51:51 +08:00
Improve datepicker interactions for item sidebar [SCI-9956]
This commit is contained in:
parent
f2a4e91d23
commit
122c3aff1a
1 changed files with 14 additions and 3 deletions
|
@ -308,7 +308,14 @@ export default {
|
||||||
handleOutsideClick(event) {
|
handleOutsideClick(event) {
|
||||||
if (!this.isShowing) return;
|
if (!this.isShowing) return;
|
||||||
|
|
||||||
const allowedSelectors = ['a', '.modal', '.label-printing-progress-modal', '.atwho-view'];
|
const allowedSelectors = [
|
||||||
|
'a',
|
||||||
|
'.modal',
|
||||||
|
'.dp__instance_calendar',
|
||||||
|
'.label-printing-progress-modal',
|
||||||
|
'.atwho-view'
|
||||||
|
];
|
||||||
|
|
||||||
const excludeSelectors = ['#myModuleRepositoryFullViewModal'];
|
const excludeSelectors = ['#myModuleRepositoryFullViewModal'];
|
||||||
|
|
||||||
const isOutsideSidebar = !$(event.target).parents('#repository-item-sidebar-wrapper').length;
|
const isOutsideSidebar = !$(event.target).parents('#repository-item-sidebar-wrapper').length;
|
||||||
|
@ -348,7 +355,7 @@ export default {
|
||||||
this.loadRepositoryRow(repositoryRowUrl);
|
this.loadRepositoryRow(repositoryRowUrl);
|
||||||
this.currentItemUrl = repositoryRowUrl;
|
this.currentItemUrl = repositoryRowUrl;
|
||||||
},
|
},
|
||||||
loadRepositoryRow(repositoryRowUrl) {
|
loadRepositoryRow(repositoryRowUrl, scrollTop = 0) {
|
||||||
this.dataLoading = true
|
this.dataLoading = true
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
@ -368,13 +375,17 @@ export default {
|
||||||
this.dataLoading = false;
|
this.dataLoading = false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.generateBarCode(this.defaultColumns.code);
|
this.generateBarCode(this.defaultColumns.code);
|
||||||
|
|
||||||
|
// if scrollTop was provided, scroll to it
|
||||||
|
this.$nextTick(() => { this.$refs.bodyWrapper.scrollTop = scrollTop; });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reload() {
|
reload() {
|
||||||
if (this.isShowing) {
|
if (this.isShowing) {
|
||||||
this.loadRepositoryRow(this.currentItemUrl);
|
// perserve scrollTop on reload
|
||||||
|
this.loadRepositoryRow(this.currentItemUrl, this.$refs.bodyWrapper.scrollTop);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showRepositoryAssignModal() {
|
showRepositoryAssignModal() {
|
||||||
|
|
Loading…
Reference in a new issue