From d9ba34d5b4041fb57e3ecb558e0b43c5d3993ba5 Mon Sep 17 00:00:00 2001 From: maxpozdeev Date: Thu, 8 Sep 2022 00:31:13 +0300 Subject: [PATCH] * close ajax alert on back button click --- src/content/mytinytodo.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/content/mytinytodo.js b/src/content/mytinytodo.js index b8eb01f..ded7a0a 100644 --- a/src/content/mytinytodo.js +++ b/src/content/mytinytodo.js @@ -544,7 +544,7 @@ var mytinytodo = window.mytinytodo = _mtt = { // AJAX Errors $(document).ajaxSend(function(r,s){ - $("#msg").hide().removeClass('mtt-error mtt-info').find('.msg-details').hide(); + hideAlert(); clearTimeout(_mtt.timers.ajaxAnimation); _mtt.timers.ajaxAnimation = setTimeout( function(){ $("#mtt").addClass("ajax-loading"); @@ -831,6 +831,7 @@ var mytinytodo = window.mytinytodo = _mtt = { pageBack: function(clicked) { + hideAlert(); // If clicked on back button in settings we'll use history navigation if ( clicked && this.pages.current && this.pages.current.page == 'ajax' && this.pages.current.pageClass == 'settings' && @@ -2525,6 +2526,11 @@ function toggleMsgDetails() else el.hide() } +function hideAlert() +{ + $("#msg").hide().removeClass('mtt-error mtt-info').find('.msg-details').hide(); +} + /* Authorization