Jump to content
View in the app

A better way to browse. Learn more.

Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ips.ui.alert

Description

The alert widget is designed to replace the built-in javascript alert, providing a more pleasant user experience as well as more flexible options and built in callbacks. Several other types of alert dialogs are supported too.

Usage

Unlike most UI widgets, the alert widget is instantiated programatically, rather than using the data API - typically as a response to a user action in a controller, for example.

An alert is created as follows:

ips.ui.alert.show( {
	type: 'alert',
	icon: 'warning',
	message: 'Alert message',
	subText: 'Message subtext',
	callbacks: {
		ok: function () {
			// Do something
		}
	}
});

Each type of alert shows different buttons depending on the use; a callback can be assigned to each button shown for that type.

Alert types

Alert

Shows a message, with a single button to dismiss the alert.

  • Type: alert
  • Available button callbacks: ok

 

Confirm

Confirm shows a message with OK and Cancel buttons.

  • Type: confirm
  • Available button callbacks: ok, cancel

 

Prompt

Shows a message with OK and Cancel buttons, and prompts the user to input a value. Both callbacks receive the entered value as the first parameter.

  • Type: prompt
  • Available button callbacks: ok, cancel

 

Verify

Verify shows a message with Yes and No buttons.

  • Type: verify
  • Available button callbacks: yes, no

 

Events

No events are emitted by the alert widget; since callbacks are supported, custom events can be triggered inside them to achieve desired functionality.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.