forked from Netsach/bootstrap.alert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_confirmable_alert.html
64 lines (53 loc) · 2.4 KB
/
test_confirmable_alert.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<title>confirmable alert bootstrap</title>
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="bower_components/timecircles/inc/TimeCircles.css">
</head>
<body>
<form class="container">
<div class="form-group">
<label for="sel1">Select list:</label>
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>
<input type="submit" name="" value="send" id="send-form">
</form>
<a href="http://www.google.com" id="link-test">Test</a>
<button class="btn-callback">click with callback</button>
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="bower_components/timecircles/inc/TimeCircles.js"></script>
<script type="text/javascript" src="bower_components/underscore/underscore.js"></script>
<script type="text/javascript" src="bootstrap.alert.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#send-form").init_confirmable_alert();
$(".btn-callback").init_confirmable_alert({ callback_confirm: function(){console.log('coucou');}});
$("#link-test").init_confirmable_alert();
});
// $('#send-form').on('click', function(event, options) {
// options = options || {};
// if ( !options.final_event ) {
// event.preventDefault();
// // Custom code HERE
// console.log('coucou');
// for (var i = 1; i <= 50; i++) {
// console.log(i);
// }
// // Fake isDefaultPrevented to allow fire event after preventDefault
// event.isDefaultPrevented = function(){ return false; }
// // retrigger the submit event with final_event set to true
// $(event.currentTarget).trigger(event, { 'final_event': true });
// } else {
// /* allow default behavior to happen */
// }
// });
</script>
</body>
</html>