Skip to content

Commit

Permalink
Small cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Oct 20, 2023
1 parent 145369f commit 55eb586
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions deposit/static/deposit/js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ $(function () {
startBrowsing()
}

window.onbeforeunload = function(e){
if(!$('#uploads').hasClass('hidden')) {
if ($('.uploads-total-progress-bar-perc').html() != '100%') {
window.onbeforeunload = function (e) {
if (!$('#uploads').hasClass('hidden')) {
if ($('.uploads-total-progress-bar-perc').html() !== '100%') {
return e.returnValue
}
}
Expand Down
6 changes: 3 additions & 3 deletions research/static/research/js/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ $(function () {
startBrowsing()
}

window.onbeforeunload = function(e){
if(!$('#uploads').hasClass('hidden')) {
if ($('.uploads-total-progress-bar-perc').html() != '100%') {
window.onbeforeunload = function (e) {
if (!$('#uploads').hasClass('hidden')) {
if ($('.uploads-total-progress-bar-perc').html() !== '100%') {
return e.returnValue
}
}
Expand Down
24 changes: 12 additions & 12 deletions search/static/search/js/revision.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
let revisionTargetColl = ''
let folderSelectBrowser = null
let dlgCurrentFolder = ''
let currentSearchString
let currentSearchType
let currentSearchStringRev
let currentSearchTypeRev

$(document).ready(function () {
if ($('#file-browser').length && $('#search-filter').val().length > 0) {
currentSearchString = $('#search-filter').val()
currentSearchType = $('#search_concept').attr('data-type')
currentSearchStringRev = $('#search-filter').val()
currentSearchTypeRev = $('#search_concept').attr('data-type')

if (currentSearchType === 'revision') {
if (currentSearchTypeRev === 'revision') {
startBrowsing()
}
}
Expand All @@ -28,15 +28,15 @@ $(document).ready(function () {
})

$('.search-btn').on('click', function () {
currentSearchString = $('#search-filter').val()
currentSearchType = $('#search_concept').attr('data-type')
currentSearchStringRev = $('#search-filter').val()
currentSearchTypeRev = $('#search_concept').attr('data-type')
browseRevisions()
})

$('#search-filter').bind('keypress', function (e) {
if (e.keyCode === 13) {
currentSearchString = $('#search-filter').val()
currentSearchType = $('#search_concept').attr('data-type')
currentSearchStringRev = $('#search-filter').val()
currentSearchTypeRev = $('#search_concept').attr('data-type')
browseRevisions()
}
})
Expand Down Expand Up @@ -99,7 +99,7 @@ const getRevisionListContents = (() => {
const get = async (args) => {
// Check if we can use the cache.
if (cache.length &&
currentSearchString === cacheSearchArg && /// DIT MOET SEARCH ARGUMENT WORDEN!!!
currentSearchStringRev === cacheSearchArg && /// DIT MOET SEARCH ARGUMENT WORDEN!!!
// && args.order[0].dir === cacheSortOrder
// && args.order[0].column === cacheSortCol
args.start >= cacheStart &&
Expand All @@ -111,7 +111,7 @@ const getRevisionListContents = (() => {

const result = await Yoda.call('revisions_search_on_filename',
{
searchString: currentSearchString, /// TOEVOEGEN SEARCH ARGUMENT
searchString: currentSearchStringRev, /// TOEVOEGEN SEARCH ARGUMENT
offset: args.start,
limit: batchSize
})
Expand All @@ -123,7 +123,7 @@ const getRevisionListContents = (() => {
total = result.total
cacheStart = args.start
cache = result.items
cacheSearchArg = currentSearchString
cacheSearchArg = currentSearchStringRev
// cacheSortCol = args.order[0].column;
// cacheSortOrder = args.order[0].dir;

Expand Down

0 comments on commit 55eb586

Please sign in to comment.