Notifications

19 views

Description

This article explains how to prevent a Service Portal modal window from closing when clicking outside the modal window.

Procedure

This behaviour is controlled by the backdrop property of the modal window, it needs to be set to backdrop: 'static'

Examples:

All of these examples are in the Client Controller section of a widget.

Simple modal window

function(spModal) {
  /* widget controller */
  var c = this;

    spModal.open({
        title: 'Sup?',
        backdrop: 'static'
    });
}

Using the OOB 'widget-modal' as a wrapper

if (input && input.action === "edit_item") {
  data.editVariablesModal = $sp.getWidget('widget-modal', {
    embeddedWidgetId: 'sp-variable-editor',
    embeddedWidgetOptions: {
      sys_id: input.itemID,
      table: "sc_cart_item",
      showItemTitle: true,
      isOrdering: true 
    },
    backdrop: 'static'    // this is what you have to add
    });
  return;
}

Applicable Versions

Helsinki and above

Additional Information

Reference: https://stackoverflow.com/questions/20702327/angular-modal-backdrop-issue

Article Information

Last Updated:2019-06-20 05:51:33
Published:2019-06-20