Skip to content

Instantly share code, notes, and snippets.

@js1972
Created May 21, 2014 03:42
Show Gist options
  • Save js1972/d1bf1bdd57d656ac0706 to your computer and use it in GitHub Desktop.
Save js1972/d1bf1bdd57d656ac0706 to your computer and use it in GitHub Desktop.
Cancel a UI5 dialog when clicked outside. With Twitter Bootstrap dialogs you can click anywhere on the page outside of the dialog to close it (as if you had clicked the close button). This basis jQuery code enables the same with a UI5 app. The example below is with the sap.m.ResponsivePopover control but it works with any dialog that uses a bloc…
$(function() {
$('body').on('click', '#sap-ui-blocklayer-popup', function() {
var popover = sap.ui.getCore().byId('responsivePopover');
popover.close();
popover.destroy();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment