Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jlcvolleyball committed Jul 27, 2023
1 parent 5bda7c7 commit 8b2b414
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions FaceDemo/public/js/modes/ImageMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ImageMode extends Mode {

//add remove image button
let buttonRemove = $(`<a href="#!" class="waves-effect waves-light btn blue" style="margin-right: 10px;">Remove</a>`).appendTo(this._slideOut.root());
buttonRemove.get(0).addEventListener('click', () => { this._slideOut.close(); });
buttonRemove.get(0).addEventListener('click', () => { this._onRemoveImage() });

//add clear all images button
let buttonClear = $(`<a href="#!" class="waves-effect waves-light btn blue" style="margin-right: 10px;">Clear</a>`).appendTo(this._slideOut.root());
Expand Down Expand Up @@ -212,21 +212,27 @@ class ImageMode extends Mode {
this._setFeed(select.value());
}

_onRemoveImage(select) {

_onRemoveImage() {
var elementsToRemove = document.querySelectorAll(".thumbnail.selected")
if(elementsToRemove.length > 0) {
for(var i=0; i<elementsToRemove.length; i++) {
var element = elementsToRemove[i];
element.parentNode.removeChild(element);
}
}
}

_onClearImage() {
app.imageLibrary().clearImages()
this._imagePicker.initialize(app.imageLibrary().nImages() - 1)
//this._setFeed(app.imageLibrary().nImages() - 1)
this._setFeed(app.imageLibrary().nImages() - 1)
console.log("clearing image")
}

_onDefaultImages() {
app.imageLibrary().resetDefaultImages()
this._imagePicker.initialize(app.imageLibrary().nImages() - 1);
//this._setFeed(app.imageLibrary().nImages() - 1);
this._setFeed(app.imageLibrary().nImages() - 1);
console.log("setting images to default")
}

Expand Down

0 comments on commit 8b2b414

Please sign in to comment.