-
Notifications
You must be signed in to change notification settings - Fork 231
/
test-issue193.html
66 lines (66 loc) · 1.85 KB
/
test-issue193.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
65
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title> issue (#193)</title>
<link href="bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="../src/jquery.webui-popover.css" />
<script src="jquery.js" ></script>
<script src="../src/jquery.webui-popover.js" ></script>
<style type="text/css">
.u-text--edit {
color: #cc3333;
border-bottom: 1px dotted;
cursor: pointer;
}
</style>
<script type="text/javascript">
$(function() {
$('.u-text--edit').webuiPopover({
placement:'horizontal',
animation:'pop',
width:300,
cache:false,
closeable:true,
content: '<div class="form-group"><label for="value">Value</label><input type="number" name="value" class="form-control" id="value"></div><button class="btn btn-primary" id="changevalue">Confirm</button>',
onShow: function(e) {
var clickedElement = $(e).data('trigger-element');
$(clickedElement).append(' clicked');
$(e).find('#value').focus();
$(e).find('#changevalue').on('click', function(){
var newVal = $('#value').val();
$('.u-text--edit').webuiPopover('hide');
clickedElement.text(newVal);
})
}
});
});
</script>
</head>
<body>
<table class="table">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cell 1</td>
<td><span class="u-text--edit">123</span></td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 1</td>
<td><span class="u-text--edit">234</span></td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 1</td>
<td><span class="u-text--edit">345</span></td>
<td>Cell 3</td>
</tr>
</tbody>
</table>
</body>
</html>