Cireson - Edit (next to tasks)
Dear All,
On the grid view when selecting an incident I would like to remove the "edit" next to "tasks".
Does anyone have any code to do this?
Thanks
Daniel
Best Answer
-
Konstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
You can hide it with css instead, so you don't have to rely on getting the timing right in js with this selector:
#drawer-taskbar span.btn-group:nth-child(1)
I've browsed around, and it should only be the 'Edit'-button, which is hit by that selector.
(Edit) So you'd put this in your custom.css:
/* Hide Edit button */ #drawer-taskbar span.btn-group:nth-child(1) { display: none; } /* Also hide divider */ .drawertaskbar .drawertaskbar-commands .divider-left::before { border-left: 0; }
5
Answers
You just need to do a little JS like below. Make sure you change the GUID to match your homepage URL and you can change the timeout to better match how long your pages take to load.
if(window.location.href.includes("f94d43eb-eb42-4957-8c48-95b9b903c631")){
setTimeout(function(){
dr = document.getElementById("drawer-taskbar");
dr.getElementsByClassName("btn-group")[0].style.display = "none";
}, 3000);
}
Hi James,
Thanks for the help but I need to remove this function across all views though.
Thanks
Daniel
You can add other GUIDs for pages like My Work or Active Work.
Just add some or's to the if statement. These are the GUIDs I have for My Work, Team Work and Active Work. Don't think there are any other views it shows up on.
if(window.location.href.includes("f94d43eb-eb42-4957-8c48-95b9b903c631") || window.location.href.includes("62f452d5-66b5-429b-b2b1-b32d5562092b") || window.location.href.includes("cca5abda-6803-4833-accd-d59a43e2d2cf")){
setTimeout(function(){
dr = document.getElementById("drawer-taskbar");
dr.getElementsByClassName("btn-group")[0].style.display = "none";
}, 3000);
}
There might be a better way to identify the button so you could just use the script on every page and check if it exists but I don't see any good way to do that.
James
You can hide it with css instead, so you don't have to rely on getting the timing right in js with this selector:
#drawer-taskbar span.btn-group:nth-child(1)
I've browsed around, and it should only be the 'Edit'-button, which is hit by that selector.
(Edit) So you'd put this in your custom.css:
That's worked thank you.
Kind Regards
Daniel