Skip to content

Commit d9701cf

Browse files
authored
YDA-6639: reset multiselect checkbox after folder change
1 parent b0de080 commit d9701cf

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

deposit/static/deposit/js/data.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ function changeBrowserUrl (path) {
689689
}
690690

691691
function browse (dir = '', changeHistory = false) {
692+
resetMultiSelectCheckbox()
692693
currentFolder = dir
693694
makeBreadcrumb(dir)
694695
if (changeHistory) { changeBrowserUrl(dir) }
@@ -700,6 +701,12 @@ function browse (dir = '', changeHistory = false) {
700701
apostropheFolderHints(dir)
701702
}
702703

704+
function resetMultiSelectCheckbox () {
705+
$('#multi-select-all').prop({ checked: false })
706+
$('#multiSelect').addClass('hide')
707+
$("input[name='multiSelect[]']").prop('checked', false)
708+
}
709+
703710
function apostropheFolderHints (dir) {
704711
// Apostrophe in the name, so disable upload/creation
705712
if (dir.indexOf('\'') > -1) {

research/static/research/js/research.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ function changeBrowserUrl (path) {
879879
}
880880

881881
function browse (dir = '', changeHistory = false) {
882+
resetMultiSelectCheckbox()
882883
currentFolder = dir
883884
// remove hide class that could have been added when a erroneous vault path was used.
884885
$('#file-browser_wrapper').removeClass('hide')
@@ -890,6 +891,12 @@ function browse (dir = '', changeHistory = false) {
890891
buildFileBrowser()
891892
}
892893

894+
function resetMultiSelectCheckbox () {
895+
$('#multi-select-all').prop({ checked: false })
896+
$('#multiSelect').addClass('hide')
897+
$("input[name='multiSelect[]']").prop('checked', false)
898+
}
899+
893900
function handleGoToVaultButton (dir) {
894901
// Handle the button with which to return to the corresponding research area.
895902
const parts = dir.split('/')

vault/static/vault/js/vault.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ function changeBrowserUrl (path) {
370370
}
371371

372372
function browse (dir = '', changeHistory = false) {
373+
resetMultiSelectCheckbox()
373374
currentFolder = dir
374375
// remove hide class that could have been added when a erroneous vault path was used.
375376
$('#file-browser_wrapper').removeClass('hide')
@@ -390,6 +391,12 @@ function browse (dir = '', changeHistory = false) {
390391
topInformation(dir, true, true)
391392
}
392393

394+
function resetMultiSelectCheckbox () {
395+
$('#multi-select-all').prop({ checked: false })
396+
$('#multiSelect').addClass('hide')
397+
$("input[name='multiSelect[]']").prop('checked', false)
398+
}
399+
393400
function handleGoToResearchButton (dir) {
394401
// Handle the button with which to return to the corresponding research area.
395402
const parts = dir.split('/')

0 commit comments

Comments
 (0)