show chosen seat

This commit is contained in:
Olga 2019-12-07 11:56:51 +01:00
parent d1f6775a8f
commit eb377c8caa
4 changed files with 18 additions and 5 deletions

View File

@ -21,11 +21,13 @@ body {
font-size: 22px; font-size: 22px;
} }
#selected-seats { #sel-seat {
font-size: 30px; font-size: 30px;
text-shadow: 1px 1px 1px rgb(160, 160, 160); text-shadow: 1px 1px 1px rgb(160, 160, 160);
margin-top: -15px; margin-top: -15px;
margin-bottom: 100px; margin-bottom: 100px;
padding: 0;
} }
button { button {

View File

@ -15,7 +15,7 @@
<h2>Anna Kowalska</h2> <h2>Anna Kowalska</h2>
<h3>wybrane miejsce:</h3> <h3>wybrane miejsce:</h3>
<h3 id="selected-seats">rząd 2 miejsce 3</h3> <ul id="sel-seat"></ul>
<button class="gotomain-button" onclick="doStronyGlownej()">Przejdź do strony głównej &raquo;</button> <button class="gotomain-button" onclick="doStronyGlownej()">Przejdź do strony głównej &raquo;</button>
</div> </div>
@ -24,7 +24,11 @@
<script> <script>
function doStronyGlownej() { function doStronyGlownej() {
window.location = "przylozlegitke.html"; window.location = "przylozlegitke.html";
} }
//alert(localStorage.getItem('myElement')); //Przykładowa wartość
$( document ).ready(function() {
$("#sel-seat").text(localStorage.getItem('myElement'));
});
</script> </script>
</html> </html>

View File

@ -24,7 +24,7 @@
<div id="legend"> <div id="legend">
</div> </div>
<div class="booking-details"> <div class="booking-details">
<h2>Anna Kowalska</h2> <h2 id="studentName">Anna Kowalska</h2>
<h3>Wybrane miejsce:</h3> <h3>Wybrane miejsce:</h3>
<ul id="selected-seats"></ul> <ul id="selected-seats"></ul>
@ -35,7 +35,6 @@
</div> </div>
</body> </body>
<script> <script>
function goToKoncowa() { function goToKoncowa() {
window.location = "koncowastrona.html"; window.location = "koncowastrona.html";
} }

View File

@ -2,7 +2,10 @@ var firstSeatLabel = 1;
$(document).ready(function() { $(document).ready(function() {
var $cart = $('#selected-seats'), var $cart = $('#selected-seats'),
seatNumber = '',
$placeNumber = ('#sel-seat'),
$counter = $('#counter'), $counter = $('#counter'),
$name = $('#studentName'),
$total = $('#total'), $total = $('#total'),
sc = $('#seat-map').seatCharts({ sc = $('#seat-map').seatCharts({
map: [ map: [
@ -46,6 +49,9 @@ var firstSeatLabel = 1;
.data('seatId', this.settings.id) .data('seatId', this.settings.id)
.appendTo($cart); .appendTo($cart);
seatNumber = 'rząd: ' + this.settings.row + ' miejsce: ' + this.settings.label;
localStorage.setItem('myElement', seatNumber);
/* /*
* Lets update the counter and total * Lets update the counter and total
* *
@ -64,6 +70,7 @@ var firstSeatLabel = 1;
//remove the item from our cart //remove the item from our cart
$('#cart-item-'+this.settings.id).remove(); $('#cart-item-'+this.settings.id).remove();
$('#item-'+this.settings.id).remove();
//seat has been vacated //seat has been vacated
return 'available'; return 'available';
@ -76,6 +83,7 @@ var firstSeatLabel = 1;
} }
}); });
//this will handle "[cancel]" link clicks //this will handle "[cancel]" link clicks
$('#selected-seats').on('click', '.cancel-cart-item', function () { $('#selected-seats').on('click', '.cancel-cart-item', function () {
//let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here //let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here