Projekt

Obecné

Profil

Stáhnout (1.38 KB) Statistiky
| Větev: | Revize:
1
<div id="remove-modal" class="modal fade" role="dialog">
2
	<div class="modal-dialog modal-dialog-centered" role="document">
3
		<div class="modal-content">
4
			 <div class="modal-header">
5
					<h4 class="modal-title">Potvrdit odstranění</h4>
6
					<button type="button" class="close" data-dismiss="modal">&times;</button>
7
			 </div>
8
			 <div class="modal-body">
9
				<div class="container">
10
					<div class="row">
11
                        <p id="mesBody"></p>
12
                    </div>
13
				</div>
14
			 </div>
15
			 <div class="modal-footer">
16
                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="removeSelectedItem(document.getElementById('idToRemoveInput').value)">Ano</button>
17
                <button type="button" class="btn btn-default" data-dismiss="modal">Ne</button>
18
				<input type="hidden" id="idToRemoveInput" />
19
			</div>
20
		</div>
21
	</div>
22
</div>
23

    
24
<script>
25
    $('#remove-modal').on('show.bs.modal', function (event){ //wait for modal to show 
26
        const button = $(event.relatedTarget);
27
        const pseudo_id = button.data('pseudo-id');//Extract info from data-* attributes
28

    
29
        const data_obj = data[pseudo_id];
30
        let modal = $(this);
31

    
32
		modal.find('#mesBody').text("Opravdu chcete odstranit záznam týkající se slova \"" + data_obj.word + "\"?");
33
		modal.find('#idToRemoveInput').val(data_obj.id); //assign id to delete to hidden input
34
    });
35
</script>
(6-6/8)