Extra close button is displayed by default while using g_modal.showframe()

Narayana RC
Tera Contributor

 

I have created UI page and calling it in UI Action Workspace client script, glide dilague window has close button by default by the system.

I have used g_modal.showframe method in the workspace client script to call the ui page url. Is there somewhere I can go to remove it?

 

NarayanaRC_0-1708951277433.png

 

 

5 REPLIES 5

Ademir Amaral1
Kilo Sage

Hi @Narayana RC 

 

Try setting show_close to false.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

tried it by adding show_close into g_modal.showFrame() but its not working as expected

Subhashis Ratna
Tera Guru

Hi @Narayana RC 

Would you mind sharing the script or providing a screenshot for additional reference?

Try this Fix :

To remove the Close button from a modal in the Agent Workspace, you can follow these steps:

1. Navigate to the Agent Workspace.

2. Open the modal where you want to remove the Close button.

3. Right-click on the modal and select "Inspect" to open the browser's Developer Tools.

4. In the Elements tab, find the HTML code for the Close button. It should be something like

5. Note down the class or ID of the close button.

6. Now, navigate to System UI > UI Pages  in ServiceNow

7. Find the UI Page for the Agent Workspace

8. In the Client Script section, add this script:

   

addLoadEvent(function() {
  var closeButton = document.querySelector('.close'); //replace '.close' with the class or ID you noted down
  if(closeButton) {
    closeButton.style.display = 'none';
 }
});


Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.

Thank you!
Subhashisr7

#workspace-ui .now-modal-footer {
    display: none !important;
}
.now-modal-footer {
    display: none !important;
 
This is what i have used in UI Page html code and also have used steps that you have mentioned in above on client script but no luck.
 
I can make close button invisible by modifying html tag in inspect->open elements->update class
 
is this really possible to hide with UI Page? just asking