Enable inline confirmation for clickable elements.
- License:
- MIT
- Source:
Methods
$.fn.confirmable([options]) → {jQuery}static
#
Enable inline confirmation for given clickable element (like <a />
or <button />
).
An additional inline confirmation step being shown before the default action is carried out on click.
Calling .confirmable( { handler: function () { … } } )
will fire the handler only after the
confirmation step.
The element will have the jquery-confirmable-element
class added to it when it's clicked for
the first time, which has white-space: nowrap;
and display: inline-block;
defined in CSS.
If the computed values for the element are different when you make it confirmable, you might
encounter unexpected behavior.
To use this jQuery
plugin, load the jquery.confirmable
module with mw.loader
.
Example
mw.loader.using( 'jquery.confirmable' ).then( () => {
$( 'button' ).confirmable();
} );
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional |
Properties:
|
- Source:
Returns:
- Type
- jQuery
<a />
or <button />
).