Remove favorite button
Dear All,
I need to remove the favorite button next to cancel on the service catalog portal.
Any help with this?
Daniel
Best Answers
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
Adding this to your custom.js in some form should hide that button:
$(document).ready(function () {
setTimeout(function() {
var url = window.location.href;
if (url.indexOf("ServiceCatalog/RequestOffering") > 0 ) {
$('button:contains("Favorite")').hide();
}
}, 1400);
});
5 -
CaterhamITSupport Member Advanced IT Monkey ✭✭✭
Hi Justin,
After some searching the following code seems to work, but thank you for the help with this:
custom.css:
#drawer-taskbar > button:nth-last-of-type(-n+2){ Visibility: hidden;}
Kind Regards
Daniel
0 -
Shane_White Cireson Support Super IT Monkey ✭✭✭✭✭
I would stick to Justin's code because the CSS code you are using I believe will remove the 'Cancel' button on Work Items, so I suggest reducing the timeout on Justin's code to minimise the risk of seeing it disappear!
}, 1400); To something like }, 1000); Or even lower if you portal will load fast enough, this is just ensuring the element is on the page before it tries to hide it
Thanks,
Shane
5
Answers
Adding this to your custom.js in some form should hide that button:
$(document).ready(function () {
setTimeout(function() {
var url = window.location.href;
if (url.indexOf("ServiceCatalog/RequestOffering") > 0 ) {
$('button:contains("Favorite")').hide();
}
}, 1400);
});
Hi Justin,
This seems to work but shows up and then quickly disappears which is not ideal.
Thanks for the help so far.
Daniel
Hi Justin,
After some searching the following code seems to work, but thank you for the help with this:
custom.css:
#drawer-taskbar > button:nth-last-of-type(-n+2){ Visibility: hidden;}
Kind Regards
Daniel
Hi @CaterhamITSupport
I would stick to Justin's code because the CSS code you are using I believe will remove the 'Cancel' button on Work Items, so I suggest reducing the timeout on Justin's code to minimise the risk of seeing it disappear!
}, 1400); To something like }, 1000); Or even lower if you portal will load fast enough, this is just ensuring the element is on the page before it tries to hide it
Thanks,
Shane
Hi Shane,
Ok thank you and I have tested and changed from 1400 to 5. We have the portal on a fairly good server and the refresh rate is good.
Thanks
Daniel
Hi Shane/Justin,
You both are right and i can see what you mean now.
My only issue with this is that it shows for a second then goes still.
Dependent on the form and how much is on there as well.
I set it to 500 at the moment, do you have any other ways of doing this?
Daniel
Hi Shane,
Here is a picture attached, so I wanted to disable the favorites and icon. Also wanted when you click on the icon it opens the request offering.
Daniel