Browse Source

fix reloading of news items on ignore

CauseFX 5 years ago
parent
commit
717e23bd99
1 changed files with 4 additions and 3 deletions
  1. 4 3
      js/functions.js

+ 4 - 3
js/functions.js

@@ -3461,7 +3461,8 @@ function ignoreNewsId(id){
 		try {
 			let response = data.response;
 			message('News Item','Id now ignored',activeInfo.settings.notifications.position,"#FFF","success","5000");
-			newsLoad();
+			$('.newsItem-' + id).remove();
+			$('.newsHeart-' + id).remove();
 		}catch(e) {
 			organizrCatchError(e,data);
 		}
@@ -3484,8 +3485,8 @@ function newsLoad(){
 				        count++;
 				        let ignore = ignoredIds.includes(v.id);
 				        let alertDefined = (typeof v.important !== 'undefined' || v.important === false);
-				        let alert = (alertDefined && ignore == false) ? `<span class="animated loop-animation flash text-danger mouse" onclick="ignoreNewsId('${v.id}')">&nbsp; <i class="ti-alert"></i>&nbsp; Important Message - Click me to Ignore</span>` : '';
-				        let heartBeat = (alertDefined && ignore == false) ? '<div class="notify pull-left"><span class="heartbit"></span><span class="point"></span></div>' : '';
+				        let alert = (alertDefined && ignore == false) ? `<span class="animated loop-animation flash text-danger mouse newsItem-${v.id}" onclick="ignoreNewsId('${v.id}')">&nbsp; <i class="ti-alert"></i>&nbsp; Important Message - Click me to Ignore</span>` : '';
+				        let heartBeat = (alertDefined && ignore == false) ? `<div class="notify pull-left newsHeart-${v.id}"><span class="heartbit"></span><span class="point"></span></div>` : '';
 				        let newBody = `
 			                <h5 class="pull-left">`+moment(v.date).format('LLL')+`</h5>
 			                <h5 class="pull-right">`+v.author+`</h5>