Fixing BUGs 144/145, (needed a parseInt), and force MovedBox path selection to Storage always - if moving from Import path, likely storing, if in Storage path, likely moving inside the Storage area, user can always override
This commit is contained in:
1
BUGs
1
BUGs
@@ -1,5 +1,4 @@
|
||||
### Next: 146
|
||||
BUG-145: when I selected a few files with ctrl-click, moved them, the end result was "no files in path"
|
||||
BUG-143: if I skip next fast enough in files_ip, it can get the warning about changes to entry list... (would have though I disabled next page until loaded)
|
||||
BUG-142: after transforming, the face data is still in the old spots, really should delete it / make it recalc
|
||||
BUG-141: can currently try to flip a video (in a highlighted group)
|
||||
|
||||
@@ -89,7 +89,7 @@ function GetExistingDirsAsDiv( dt, divname, ptype )
|
||||
|
||||
// show the DBox for a move file, includes all thumbnails of selected files to move
|
||||
// and a pre-populated folder to move them into, with text field to add a suffix
|
||||
function MoveDBox(path_details)
|
||||
function MoveDBox()
|
||||
{
|
||||
$('#dbox-title').html('Move Selected File(s) to new directory in Storage Path')
|
||||
div =`
|
||||
@@ -99,7 +99,7 @@ function MoveDBox(path_details)
|
||||
<form id="mv_fm" class="form form-control-inline col-12">
|
||||
<input id="move_path_type" name="move_path_type" type="hidden"
|
||||
`
|
||||
div += ' value="' + path_details[0].type.name + '"></input>'
|
||||
div += ' value="' + move_paths[0].type.name + '"></input>'
|
||||
div+=GetSelnAsDiv()
|
||||
yr=$('.highlight').first().attr('yr')
|
||||
dt=$('.highlight').first().attr('date')
|
||||
@@ -110,10 +110,10 @@ function MoveDBox(path_details)
|
||||
<alert class="alert alert-primary my-auto py-1">
|
||||
`
|
||||
// NB: alert-primary here is a hack to get the bg the same color as the alert primary by
|
||||
div+= '<svg id="move_path_icon" width="20" height="20" fill="currentColor"><use xlink:href="' + path_details[0].icon_url + '"></svg>'
|
||||
div+= '<svg id="move_path_icon" width="20" height="20" fill="currentColor"><use xlink:href="' + move_paths[0].icon_url + '"></svg>'
|
||||
div+= '<select id="rp_sel" name="rel_path" class="text-primary alert-primary py-1 border border-primary rounded" onChange="change_rp_sel()">'
|
||||
for(p of path_details) {
|
||||
div+= `<option path_type="${p.type.name}" icon_url="${p.icon_url}" ${(p.type.name=='Storage') ? "selected" : ""}>${p.root_dir}</option>`
|
||||
for(p of move_paths) {
|
||||
div+= `<option path_type="${p.type.name}" icon_url="${p.icon_url}">${p.root_dir}</option>`
|
||||
}
|
||||
div+= '</select>'
|
||||
div+=`
|
||||
@@ -140,6 +140,13 @@ function MoveDBox(path_details)
|
||||
</div>
|
||||
</form>
|
||||
`
|
||||
// force to Storage always - if in Import, liekly storing, if in Storage, likely moving, user can always override
|
||||
div+=`
|
||||
<script>
|
||||
storage_rp = move_paths.find(item => item.type.name === "Storage")?.root_dir;
|
||||
$('#rp_sel').val(storage_rp);change_rp_sel()
|
||||
</script>
|
||||
`
|
||||
|
||||
$('#dbox-content').html(div)
|
||||
$('#dbox').modal('show')
|
||||
@@ -675,6 +682,7 @@ function getPage(pageNumber, successCallback, viewingIdx=0)
|
||||
$('#ra').prop('disabled', true)
|
||||
const startIndex = (pageNumber - 1) * OPT.how_many;
|
||||
const endIndex = startIndex + OPT.how_many;
|
||||
console.log('pageNumber is: ' + pageNumber + ', about to make pageList from si=' +startIndex + ', to ei=' + endIndex )
|
||||
pageList = entryList.slice(startIndex, endIndex);
|
||||
|
||||
// set up data to send to server to get the entry data for entries in pageList
|
||||
@@ -850,9 +858,9 @@ function handleMoveOrDeleteOrRestoreFileJobCompleted(job)
|
||||
{
|
||||
// this grabs the values from the object attributes of eid-0, eid-1, etc.
|
||||
const ids = job.extra.filter(item => item.name.startsWith("eid-")).map(item => item.value);
|
||||
|
||||
|
||||
// find page number of first element to delete (this is the page we will return too)
|
||||
pnum=getPageNumberForId( ids[0] )
|
||||
pnum=getPageNumberForId( parseInt(ids[0]) )
|
||||
|
||||
// remove amendment data
|
||||
for (const ent of ids)
|
||||
@@ -967,7 +975,7 @@ $.contextMenu({
|
||||
callback: function( key, options) {
|
||||
if( key == "details" ) { DetailsDBox() }
|
||||
if( key == "view" ) { startViewing( $(this).attr('id') ) }
|
||||
if( key == "move" ) { MoveDBox(move_paths) }
|
||||
if( key == "move" ) { MoveDBox() }
|
||||
if( key == "del" ) { DelDBox('Delete') }
|
||||
if( key == "undel") { DelDBox('Restore') }
|
||||
if( key == "r90" ) { Transform(90) }
|
||||
|
||||
Reference in New Issue
Block a user