This repository was archived by the owner on Jan 31, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
This repository was archived by the owner on Jan 31, 2024. It is now read-only.
Ajax links in modal-footer #63
Copy link
Copy link
Open
Description
Hi, I am trying to add an ajaxed link to the modal-footer to return the user to previous page of the flow. Like so:
<!DOCTYPE html>
<html>
<head>
<title>Step 2</title>
</head>
<body>
<h1>Step 2</h1>
<form class="ajax" method="get" action="/third-page">
<input type="hidden" name="nothing" value="to-see" />
<div class="form-actions">
<a class="btn close-dialog" href="#">Close</a>
<a class="btn btn-success ajax" href="/first-page">Previous</a>
<input type="submit" value="Next" class="primary btn-success" />
</div>
</form>
</body>
</html>
However, its not executing the bound click event of the 'Previous' button, it redirects the whole page instead. Should I be using another element to get the previous page? Like a button?
My quick fix for this is to check if there is an event bound to the button or link in modal-footer like so:
Replace https://github.com/Nikku/jquery-bootstrap-scripting/blob/master/lib/jquery.dialog2.js#L208
with
var events = button.data('events');
if (typeof events === 'undefined') {
if (button.is("a")) { window.location = button[0].href }
}
What do you guys think? Should I also check for click event as well? This fix is working for me.