Skip to content

Commit 7d94e49

Browse files
committed
Fix:Add optional timeout to textMsg method
1 parent 0cd0e74 commit 7d94e49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

js/activity.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4907,7 +4907,7 @@ class Activity {
49074907
}
49084908
};
49094909

4910-
this.textMsg = (msg) => {
4910+
this.textMsg = (msg,duration = _MSGTIMEOUT_) => {
49114911
if (this.msgTimeoutID !== null) {
49124912
clearTimeout(this.msgTimeoutID);
49134913
this.msgTimeoutID = null;
@@ -4925,7 +4925,7 @@ class Activity {
49254925
this.msgTimeoutID = setTimeout(() => {
49264926
that.printText.classList.remove("show");
49274927
that.msgTimeoutID = null;
4928-
}, _MSGTIMEOUT_);
4928+
}, duration);
49294929
};
49304930

49314931
this.errorMsg = (msg, blk, text, timeout) => {

js/piemenus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3507,7 +3507,7 @@ const piemenuBlockContext = (block) => {
35073507
docById("contextWheelDiv").style.display = "none";
35083508
// prompting a notification on deleting any block
35093509
activity.textMsg(
3510-
_("You can restore deleted blocks from the trash with the Restore From Trash button.")
3510+
_("You can restore deleted blocks from the trash with the Restore From Trash button."), 3000
35113511
);
35123512
};
35133513

0 commit comments

Comments
 (0)