mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
e-ajax data-confirm option added.
This commit is contained in:
parent
5247af0098
commit
af629e0a2b
@ -148,7 +148,9 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
||||
// Old way - href='myscript.php#id-to-target.
|
||||
href: $element.attr("href"),
|
||||
// Wait for final event. Useful for keyUp, keyDown... etc.
|
||||
wait: $element.attr('data-event-wait')
|
||||
wait: $element.attr('data-event-wait'),
|
||||
// Optional confirmation message - requires user input before proceeding.
|
||||
confirm: $element.attr('data-confirm'),
|
||||
};
|
||||
|
||||
// If this is a navigation controller, e.g. pager.
|
||||
@ -539,6 +541,17 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
||||
$element.after($loadingImage);
|
||||
}
|
||||
|
||||
if(options.confirm != null)
|
||||
{
|
||||
answer = confirm(options.confirm);
|
||||
|
||||
if(answer === false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Old way - href='myscript.php#id-to-target.
|
||||
if(options.target == null || options.url == null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user