Skip to content

Commit

Permalink
Merge branch 'release/v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Aug 27, 2020
2 parents 6e1a089 + e36496b commit e7689c9
Show file tree
Hide file tree
Showing 21 changed files with 671 additions and 1,466 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![alt text](https://raw.githubusercontent.com/seatmap/canvas/master/assets/banner_ui.png?raw=true)


[LIVE DEMO](https://alisaitteke.github.io/seatmap-canvas/)
# Seatmap Canvas
A opensource seat selection
An opensource seat selection
---

![alt text](https://raw.githubusercontent.com/seatmap/canvas/master/assets/bn.jpg?raw=true)
Expand Down Expand Up @@ -148,4 +148,4 @@ seatmap.addEventListener("seat_click", (seat) => {
```
## Contributors

Ali Sait TEKE <alisaitt@gmail.com>
Ali Sait TEKE <alisaitt@gmail.com>
107 changes: 1 addition & 106 deletions build/seatmap.canvas.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/seatmap.canvas.js

Large diffs are not rendered by default.

32 changes: 24 additions & 8 deletions examples/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@
<button class="btn btn-default btn-block" id="best-find-cancel">Best Available Cancel</button>
</div>
<div class="col">
<button class="btn btn-default btn-block" id="get-data">Get Selected Seat(s) Json</button>
<button class="btn btn-default btn-block" id="get-selected-seats">Get Selected Seat(s) Json</button>
</div>
<div class="col">
<button class="btn btn-default btn-block" id="set-filter">Filter On</button>
</div>
<div class="col">
<button class="btn btn-default btn-block" id="unselect-seat" seat-id="8649695" block-id="1">Unselect Seat</button>
</div>
<div class="col">
<button class="btn btn-default btn-block" id="set-filter-disable">Filter of</button>
</div>
Expand Down Expand Up @@ -79,9 +82,9 @@

let seatmap = new SeatMapCanvas(".seats_container");
seatmap.eventManager.addEventListener("SEAT.CLICK", (seat) => {
console.log(seat)
console.log(seat.isSelected())
if (!seat.isSelected()) {
console.log("seat", seat)
// console.log(seat.isSelected())
if (!seat.isSelected() && seat.item.salable === true) {
seat.select()
} else {
seat.unSelect()
Expand All @@ -97,6 +100,19 @@
var blockId = parseInt($(this).attr('block-id'));
seatmap.zoomManager.zoomToBlock(blockId);
});
$("#get-selected-seats").on("click", function (a) {

var selectedSeats = seatmap.data.getSelectedSeats();
console.log(selectedSeats)
});

$("#unselect-seat").on("click", function (a) {
var seatid = $(this).attr('seat-id');
var blockId = $(this).attr('block-id');
var seat = seatmap.data.getSeat(seatid, blockId);
//console.log('seat',seat)
seat.svg.unSelect()
});


let block_colors = ["#00a5ff", "#ef255f", "#fccf4d", "#ef255f", "#2c2828", "#ff1f5a", "#fccf4d", "#ef255f"];
Expand Down Expand Up @@ -130,7 +146,7 @@
if (!label_index[item.rowName]) {
var label_data = {
title: item.rowName,
x: item.positionLeft + x_gap,
x: x_gap,
y: item.positionTop + y_gap
};
label_index[item.rowName] = label_data;
Expand All @@ -145,7 +161,7 @@
}
tags.push("row_" + item.rowName);
return {
id: i + "-" + (index + 1),
id: item.id,
x: item.positionLeft + x_gap + 40,
y: item.positionTop + y_gap,
color: item.color || color || null,
Expand All @@ -157,7 +173,7 @@
});

let block = {
"id": block_i + 1,
"id": (block_i + 1).toString(),
"title": "Block " + (block_i + 1),
"labels": labels,
"color": color,
Expand All @@ -182,4 +198,4 @@
});
</script>
</body>
</html>
</html>
Loading

0 comments on commit e7689c9

Please # to comment.