Skip to content

Commit

Permalink
UI: fix delete overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatthieu3 committed Sep 27, 2023
1 parent afd7514 commit 3c7d5f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/js/gui/CatalogSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ import $ from 'jquery';
'<div><input class="aladin-input" type="number" value="1.0" style="width: 4em;" maxlength="5" size="5"> <select class="aladin-selector" style="padding: 4px 0!important;"><option>deg<option>arcmin<option>arcsec</select> around view center</div>' +
'<div>Limit to <input class="aladin-input" type="number" min="1" max="10000" value="1000" style="width: 5em;"> sources</div>' +
'</div>' +
'<div class="aladin-row">' +
'<div class="aladin-col">' +
'<div><button class="aladin-btn">Load cone</button></div>' +
'</div>' +
'<div class="hips aladin-col"><button class="aladin-btn">Load catalogue HiPS</button></div>' +
'<div class="aladin-horizontal-list">' +
'<button class="aladin-btn">Load cone</button>' +
'<button class="hips aladin-btn">Load catalogue HiPS</button>' +
'</div>' +
'<div class="aladin-box-separator"></div>' +
'<div class="aladin-label" for="' + autocompleteId + '">By VOTable URL</div>' +
Expand Down
2 changes: 1 addition & 1 deletion src/js/gui/HiPSSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import $ from 'jquery';
'<div class="aladin-label" for="' + autocompleteId + '">By ID, title, keyword or URL</div>' +
'<input class="aladin-input" style="width:100%" name="' + autocompleteId + '" id="' + autocompleteId + '" type="text" placeholder="Type ID, title, keyword or URL" /><br>' +

'<div>' +
'<div class="aladin-horizontal-list">' +
'<button class="aladin-btn">Select HiPS</button>' +
'<button class="aladin-btn">Load coverage</button>' +
'</div>' +
Expand Down
8 changes: 5 additions & 3 deletions src/js/gui/Stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { HiPSLayer } from "./HiPSLayer.js";
import A from "../A.js";

import $ from 'jquery';
import { ActionButton } from "./widgets/ActionButton.js";

export class Stack {

Expand Down Expand Up @@ -242,7 +243,7 @@ export class Stack {
// retrieve SVG icon, and apply the layer color
var svgBase64 = window.btoa(iconSvg.replace(/FILLCOLOR/g, layer.color));
str += '<li class="aladin-horizontal-list"><div class="aladin-stack-icon" style=\'background-image: url("data:image/svg+xml;base64,' + svgBase64 + '");\'></div>';
str += '<input class="aladin-input" type="checkbox" ' + checked + ' id="aladin_lite_' + layer.uuid + '"></input><label for="aladin_lite_' + layer.uuid + '" class="aladin-layer-label" style="background: ' + layer.color + '; color:' + labelColor + ';" title="' + tooltipText + '">' + name + '</label>';
str += '<input class="aladin-input" type="checkbox" ' + checked + ' id="' + layer.uuid + '"></input><label for="' + layer.uuid + '" class="aladin-layer-label" style="background: ' + layer.color + '; color:' + labelColor + ';" title="' + tooltipText + '">' + name + '</label>';
str += ' <button class="aladin-btn aladin-24px-icon aladin-delete-graphic-layer" style="background-color: #eaeaea" type="button" title="Delete this layer">❌</button>';
str += '</li>';
}
Expand All @@ -251,8 +252,9 @@ export class Stack {
str += '<button class="aladin-btn catalogue-selector" type="button">Add catalogue</button>';
layerBox.append(str);

layerBox.find('.aladin-delete-graphic-layer').on('click', () => {
const layerToDelete = this.aladin.findLayerByUUID(layer.uuid);
layerBox.find('.aladin-delete-graphic-layer').on('click', (e) => {
let layerUuid = e.target.previousElementSibling.getAttribute("for");
const layerToDelete = this.aladin.findLayerByUUID(layerUuid);
this.aladin.removeLayer(layerToDelete);
});

Expand Down

0 comments on commit 3c7d5f4

Please sign in to comment.