The Inline Dialog is a wrapper for secondary content/controls to be displayed on user request. Consider this component as displayed in context to the triggering control with the dialog overlaying the page content.
An Inline Dialog should be preferred over a modal dialog when a connection between the action has a clear benefit versus having a lower user focus.
Status
API status:
deprecated
Included in AUI core?
Yes. You do not need to explicitly require the web resource key.
This binds an InlineDialog to the trigger element with id="inlineDialog". Clicking the trigger element displays a container element with id="inline-dialog-myDialog" and sets its innerHTML value to the content fetched from "dialog-content.html".
NOTE: "content.html" could have something like the following HTML: <div id="dialog-content"><h2>AUI Inline Dialog</h2></div>
determines whether the inline-Dialog will show on a mouseOver or mouseClick of the trigger.
Options: true / false
Default: false
onHover: true
closeOnTriggerClick
determines if the the Inline Dialog is closed when its trigger is clicked
Options: true / false
Default: false
closeOnTriggerClick: true
noBind
determines if the inline-Dialog will bind the event-handler to the trigger event, use this option if you wish to bind the event handler programmatically at a different point. If true then useLiveEvents is disabled.
If true then the items argument to the Inline Dialog constructor can be the empty jQuery collection, i.e., AJS.$().
Options: true / false
Default: false
noBind: true
fadeTime
determines the fade in and fade out duration of the dialog in milliseconds.
Accepts a numerical value.
Default: 100
fadeTime: 200
hideDelay
determines how long (in milliseconds) the inline-dialog will stay visible for until it is hidden (if no other trigger for hiding the dialog is fired) if null is passed auto-hide is disabled for this inline-Dialog
Accepts a Numerical value.
Default: 10000 (or null)
hideDelay: 3000
showDelay
determines how long in milliseconds after a show trigger is fired (such as a trigger click) until the dialog is shown.
Accepts a Numerical Value
Default: 0
showDelay: 200
width
Sets how wide the inline-dialog is in pixels.
Accepts a Numerical value
Default: 300
width: 400
offsetX
Sets an offset distance of the inline-dialog from the trigger element along the x-axis in pixels.
Accepts a Numerical Value or a function that takes the same arguments as calculatePositions and returns a numeric value.
Default: 0 for 'n' and 's' gravity; 10 for 'w' gravity
offsetX: 30
offsetY
Sets an offset distance of the inline-dialog from the trigger element along the y-axis in pixels.
Accepts a Numerical Value or a function that takes the same arguments as calculatePositions and returns a numeric value.
Default: 10 for 'n' and 's' gravity; 0 for 'w' gravity
offsetY: 30
container
The element in which the dialog itself will be appended.
Accepts a String or an element.
Default: "body"
container: 'head'
cacheContent
determines if the contents of the dialog are cached. If set to false the contents will be reloaded every time the dialog is shown.
Options: true / false
Default: true
cacheContent: false
hideCallback
a function that will be called after the popup has faded out.
determines if the dialog should be shown relative to where the mouse is at the time of the event trigger (normally a click) if set to false the dialog will show aligned to the left of the trigger with the arrow showing at the center.
Options: true / false
Default: false
isRelativeToMouse: true
closeOthers
determines if all other dialogs on the screen are closed when this one is opened.
Options: true / false
Default: true
closeOthers: true
responseHandler
A function that determines how the content retrieval response is handled, the default assumes that the data returned is html. The implemented function must handle the three variables: data, status, xhr and at the end return html.
determines if the dialog should be shown above the trigger or not. If this option is true but there is insufficient room above the trigger the inline-dialog will be flipped to display below it.
Deprecated in favour of gravity.
Options: true / false
Default: false
onTop: true
gravity
As of 5.5: The preferred direction in which the Inline Dialog's arrow points, e.g., 'n' makes the Inline Dialog's arrow point up (with the Inline Dialog below the trigger). When there isn't enough room to display the inline
dialog with its preferred gravity it automatically flips orientation.
Options: 'n', 's', or 'w'.
Default: 'n'
gravity: 'n'
useLiveEvents
AUI supports jQuery live events. If you choose this option, AUI will bind all events on the page to the HTML body element instead of to each
individual element. This means that your events can be bound to all current elements and to elements that do not yet exist. You no longer need to rebind everything on an Ajax load. This is essential on a page which has, for example,
a number of user avatars that react on hover. Binding can cause a performance problem when there is a large number of such elements. Disabled if noBind is true.
As of 5.0; arrowOffsetX defines an X axis offset in pixels for placement of the arrow (default is zero).
Accepts a Numerical Value or a function that takes the same arguments as calculatePositions and returns a numeric value.
arrowOffsetX: 50
arrowOffsetY
As of 5.5; arrowOffsetY defines a Y axis offset in pixels for placement of the arrow (default is zero).
Accepts a Numerical Value or a function that takes the same arguments as calculatePositions and returns a numeric value.
arrowOffsetY: 50
persistent
As of 5.1: if persistent: true the Inline Dialog can only be dismissed programmatically by calling .hide(). This option, ignores the 'closeOthers' option. (inline-dialogs with closeOthers set to true will not close this one) and the hideDelay
option.
persistent: true
JavaScript functions
The following functions have been available since AUI 3.0. They can be called on the DOM object returned by the Inline Dialog constructor. You can call these by assigning the constructor to a DOM object such as:
...after that you can call them directly from the object (as per the table below).
Function
Details
Example
show(e, trigger)
Shows the Inline Dialog. As of 5.5: Accepts two optional parameters: an event, e, and an element, trigger. If the noBind option is true (when binding your own event handlers) and the items collection passed to the Inline Dialog constructor is empty, pass in the event object from your event handler as e and, optionally, pass your desired trigger element as trigger. If e is provided but trigger is not, e.target is used as the trigger element.
inlineDialog1.show();
hide()
Hides the Inline Dialog
inlineDialog1.hide();
refresh()
Redraws the inline-dialog. Use this function when you need to add contents to the Inline Dialog and you need it to be redrawn after your contents are inserted.