Skip to content

Commit

Permalink
Add to be removed text
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Jan 31, 2024
1 parent 800484a commit 49e7441
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions application/asset/js/jstree-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ $.jstree.plugins.removenode = function(options, parent) {
'aria-label':Omeka.jsTranslate('Restore link')
}
});
var toBeRemovedSpan = $('<span>', {
class: 'jstree-removenode-toberemoved',
style: 'display: none;'
}).text('link to be removed');
this.bind = function() {
parent.bind.call(this);
this.element.on(
Expand All @@ -31,6 +35,7 @@ $.jstree.plugins.removenode = function(options, parent) {
if (icon.hasClass('jstree-removenode-remove')) {
// Handle node removal.
node.find('.jstree-anchor').children().hide();
node.find('.jstree-anchor').children('.jstree-removenode-toberemoved').show();
icon.siblings('.jstree-removenode-undo').show();
node.addClass('jstree-removenode-removed');
nodeObj.data.remove = true;
Expand All @@ -41,6 +46,7 @@ $.jstree.plugins.removenode = function(options, parent) {
} else {
// Handle undo node removal.
node.find('.jstree-anchor').children(':not(.jstree-removenode-undo)').show();
node.find('.jstree-anchor').children('.jstree-removenode-toberemoved').hide();
icon.siblings('.jstree-removenode-remove').show();
node.removeClass('jstree-removenode-removed');
nodeObj.data.remove = false;
Expand All @@ -62,6 +68,7 @@ $.jstree.plugins.removenode = function(options, parent) {
var undoIconClone = undoIcon.clone();
anchor.append(removeIconClone);
anchor.append(undoIconClone);
anchor.append(toBeRemovedSpan.clone());

// Carry over the removed/not-removed state
var data = this.get_node(node).data;
Expand Down

0 comments on commit 49e7441

Please sign in to comment.