This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trends load error
#1
Hello,

I found some little bug in visualisation and access.

When I have regular visualisation with some widgets with individual trends and I want give some access to part of this visualisation for some person there is a error of loading trends which shouldn't be loaded. This is probably because all widgets are loaded in all situations also when not necessary like in this case. I've checked that the fast solution is when I use address to trend with IP, but I think also about optimization.

How can I delete in correct way unnecesseary widgets when some page is from specific part of the visualisation or if logged person hasn't rights for this widgets?
Reply
#2
Access right are per-plan, so the easiest way is to create separate plans with trends for each user.
Reply
#3
I like more widgets than plans for trend viewing so I've prepared such script for deleting unnecessary widgets if first page is for example 173(homepage of specific user):
Code:
// Delete unnecessary widgets
$(function(){
 if (!$('body').hasClass('usermode')) {
   return;
 }
 
if (currentPlanId == 173){
$('#widget-58,#widget-59,#widget-61,#widget-62,#widget-63,#widget-64,#widget-65,#widget-66,#widget-67,#widget-68,#widget-69,#widget-71,#widget-73,#widget-74,#widget-75,#widget-76,#widget-77,#widget-79,'+
  '#widget-80,#widget-81,#widget-82,#widget-84,#widget-85,#widget-86,#widget-88,#widget-89,#widget-91,#widget-92,#widget-93,#widget-94,#widget-95,#widget-96,#widget-97,#widget-98,#widget-99,#widget-100,'+
  '#widget-101,#widget-102,#widget-103,#widget-104,#widget-105,#widget-106,#widget-107,#widget-108,#widget-109,#widget-166,#widget-167,#widget-168,#widget-169,#widget-170,#widget-171,#widget-378,'+
  '#widget-379,#widget-387,#widget-388,#widget-393,#widget-394,#widget-396,#widget-397').remove()  
   } else if(currentPlanId == 1){
// do nothing
};
 
 });
Reply


Forum Jump: