Changed pin icon for re-dos to be a circular arrow that is not clickable to make it clear it is a redo action and cannot be cleared.

This commit is contained in:
ebolam 2022-02-03 08:08:43 -05:00
parent 3a6d8f1030
commit 0684a221cd
2 changed files with 32 additions and 18 deletions

View File

@ -2643,7 +2643,7 @@ def actionredo():
# Send sequences to UI for selection
genout = [[item['Text'], True] for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Previous Selection"]==True)]
genout = [[item['Text'], "redo"] for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Previous Selection"]==True)]
emit('from_server', {'cmd': 'genseqs', 'data': genout}, broadcast=True)
else:
emit('from_server', {'cmd': 'popuperror', 'data': "There's nothing to undo"}, broadcast=True)
@ -3082,7 +3082,7 @@ def genselect(genout):
# Store sequences in memory until selection is made
vars.genseqs = genout
genout = [[item['Text'], item['Pinned']] for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Previous Selection"]==False) and (item["Edited"]==False)]
genout = [[item['Text'], "pinned" if item['Pinned'] else "normal"] for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Previous Selection"]==False) and (item["Edited"]==False)]
# Send sequences to UI for selection
emit('from_server', {'cmd': 'genseqs', 'data': genout}, broadcast=True)

View File

@ -1163,27 +1163,41 @@ function parsegenseqs(seqs) {
seqselcontents.html("");
var i;
for(i=0; i<seqs.length; i++) {
if (seqs[i][1]) {
color = "white"
//setup selection data
text_data = "<table><tr><td width=100%><div class=\"seqselitem\" id=\"seqsel"+i+"\" n=\""+i+"\">"+seqs[i][0]+"</div></td><td width=10>"
//Now do the icon (pin/redo)
if (seqs[i][1] == "redo") {
text_data = text_data + "<span style=\"color: white\" class=\"oi oi-loop-circular\" title=\"Redo\" aria-hidden=\"true\" id=\"seqselpin"+i+"\" n=\""+i+"\"></span>"
} else if (seqs[i][1] == "pinned") {
text_data = text_data + "<span style=\"color: white\" class=\"oi oi-pin\" title=\"Pin\" aria-hidden=\"true\" id=\"seqselpin"+i+"\" n=\""+i+"\"></span>"
} else {
color = "grey"
text_data = text_data + "<span style=\"color: grey\" class=\"oi oi-pin\" title=\"Pin\" aria-hidden=\"true\" id=\"seqselpin"+i+"\" n=\""+i+"\"></span>"
}
seqselcontents.append("<table><tr><td width=100%><div class=\"seqselitem\" id=\"seqsel"+i+"\" n=\""+i+"\">"+seqs[i][0]+"</div></td><td width=10><span style=\"color: "+color+"\" class=\"oi oi-pin\" title=\"Pin\" aria-hidden=\"true\" id=\"seqselpin"+i+"\" n=\""+i+"\"></span></td></tr></table>");
text_data = text_data + "</td></tr></table>"
seqselcontents.append(text_data);
//setup on-click actions
$("#seqsel"+i).on("click", function () {
socket.send({'cmd': 'seqsel', 'data': $(this).attr("n")});
});
$("#seqselpin"+i).on("click", function () {
socket.send({'cmd': 'seqpin', 'data': $(this).attr("n")});
if ($(this).attr("style") == "color: grey") {
console.log($(this).attr("style"));
$(this).css({"color": "white"});
console.log($(this).attr("style"));
} else {
console.log($(this).attr("style"));
$(this).css({"color": "grey"});
console.log($(this).attr("style"));
}
});
//onclick for pin only
if (seqs[i][1] != "redo") {
$("#seqselpin"+i).on("click", function () {
socket.send({'cmd': 'seqpin', 'data': $(this).attr("n")});
if ($(this).attr("style") == "color: grey") {
console.log($(this).attr("style"));
$(this).css({"color": "white"});
console.log($(this).attr("style"));
} else {
console.log($(this).attr("style"));
$(this).css({"color": "grey"});
console.log($(this).attr("style"));
}
});
}
}
$('#seqselmenu').slideDown("slow");
}