Skip to content

Commit 6e1a089

Browse files
committed
Merge branch 'release/0.1.8'
2 parents 700753c + 498a3fe commit 6e1a089

File tree

10 files changed

+68
-8
lines changed

10 files changed

+68
-8
lines changed

build/seatmap.canvas.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
stroke-linejoin: round;
2525
opacity: 0.5; }
2626
.seatmap-svg .stage .blocks .block .bounds .block-hull {
27-
stroke-linejoin: round; }
27+
stroke-linejoin: round;
28+
cursor: move; }
2829
.seatmap-svg .stage .blocks .block .masks .venue-level-mask {
2930
transition-property: opacity;
3031
transition-duration: 0.5s;

build/seatmap.canvas.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seatmap/canvas",
3-
"version": "0.1.4",
3+
"version": "0.1.8",
44
"tags": "seating, seat, seatmap, seat-selection, seat-booking, booking, ticket, reservation",
55
"author": "Ali Sait TEKE <[email protected]>",
66
"homepage": "https://github.com/seatmap/canvas",

src/lib/enums/global.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export enum EventType {
2020
UPDATE_BLOCK = "BLOCK.UPDATE",
2121
CLICK_SEAT = "SEAT.CLICK",
2222
MOUSEMOVE_SEAT = "SEAT.MOUSEMOVE",
23+
MOUSEDOWN_SEAT = "SEAT.MOUSEDOWN",
2324
MOUSEENTER_SEAT = "SEAT.MOUSEENTER",
2425
MOUSELEAVE_SEAT = "SEAT.MOUSELEAVE",
2526
MOUSEOUT_SEAT = "SEAT.MOUSEOUT",

src/lib/models/defaults.model.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export default class DefaultsModel {
2424
selected: string,
2525
hover: string,
2626
focus: string,
27-
focus_out: string
27+
focus_out: string,
28+
check_color: string
2829
};
2930
block_style: {
3031
fill: string
@@ -80,7 +81,8 @@ export default class DefaultsModel {
8081
selected: config.seat_style && config.seat_style.selected || "#51ff48",
8182
hover: config.seat_style && config.seat_style.hover || "#4770ff",
8283
focus: config.seat_style && config.seat_style.focus || "#6293d2",
83-
focus_out: config.seat_style && config.seat_style.focus_out || "#ff001c"
84+
focus_out: config.seat_style && config.seat_style.focus_out || "#ff001c",
85+
check_color: config.seat_style && config.seat_style.check_color || "#ffffff",
8486
};
8587
this.block_style = {
8688
fill: config.block_style && config.block_style.fill || "#ffffff",

src/lib/svg/stage/blocks/block-item/block-item.seats.index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ export default class Seats extends SvgBase {
2626
this.global.eventManager.addEventListener(EventType.MOUSEENTER_SEAT, (seat: SeatItem) => {
2727
if (this.global.multi_select) return;
2828
seat.setColor(seat.getColor(SeatAction.HOVER));
29+
this.global.zoomManager.zoomDisable();
2930
});
3031
this.global.eventManager.addEventListener(EventType.MOUSELEAVE_SEAT, (seat: SeatItem) => {
3132
seat.setColor(seat.getColor());
33+
this.global.zoomManager.zoomEnable();
3234
});
3335

3436
return this;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* $project.fileName
3+
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
4+
*/
5+
6+
import SvgBase from "../../../../svg.base";
7+
import {dom} from "../../../../../decorators/dom";
8+
import {SeatItem} from "./seat-item.index";
9+
10+
@dom({
11+
tag: "path",
12+
class: "seat-check",
13+
autoGenerate: false
14+
})
15+
export class SeatItemCheck extends SvgBase {
16+
17+
constructor(public parent: SeatItem) {
18+
super(parent);
19+
this.attr("d", "M12.9,953.7l-6.3,6.5l-2.9-2.5l-2.1,2.4l4.1,3.5l1.1,1l1.1-1.1l7.3-7.6L12.9,953.7L12.9,953.7z");
20+
this.attr("fill", this.global.config.seat_style.check_color);
21+
this.attr("transform", "translate(-8,-959.36218)");
22+
this.attr("pointer-events", "none");
23+
this.attr("display", "none");
24+
25+
return this;
26+
}
27+
28+
update(): this {
29+
return this;
30+
}
31+
32+
afterGenerate() {
33+
this.node.style("pointer-events", "none");
34+
}
35+
36+
show():this {
37+
this.node.attr("display", "block");
38+
return this;
39+
}
40+
41+
hide():this {
42+
this.node.attr("display", "none");
43+
return this;
44+
}
45+
}

src/lib/svg/stage/blocks/block-item/seat/seat-item.index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {SeatItemCircle} from "./seat-item.circle";
1212
import {CoordinateModel} from "../../../../../models/coordinate.model";
1313
import {SeatItemTitle} from "./seat-item.title";
1414
import {SeatAction} from "../../../../../enums/global";
15+
import {SeatItemCheck} from "./seat-item.check";
1516

1617

1718
@dom({
@@ -24,6 +25,7 @@ export class SeatItem extends SvgBase {
2425
public circle: SeatItemCircle;
2526
public title: SeatItemTitle;
2627
public coordinates: CoordinateModel;
28+
public check: SeatItemCheck;
2729

2830
constructor(public parent: Seats, public item: SeatModel) {
2931
super(parent);
@@ -34,7 +36,7 @@ export class SeatItem extends SvgBase {
3436

3537
public setColor(color: string, animation: boolean = false): this {
3638
if (animation) {
37-
this.circle.node.interrupt().transition().duration(this.global.config.animation_speed).attr("fill", color);
39+
this.circle.node.transition().duration(this.global.config.animation_speed).attr("fill", color);
3840
} else {
3941
this.circle.node.attr("fill", color);
4042
}
@@ -51,13 +53,15 @@ export class SeatItem extends SvgBase {
5153
this.item.selected = true;
5254
this.node.classed("selected", true);
5355
this.circle.node.attr("fill", this.global.config.seat_style.selected);
56+
this.check.show();
5457
return this;
5558
}
5659

5760
public unSelect(): this {
5861
this.item.selected = false;
5962
this.node.classed("selected", false);
6063
this.circle.node.attr("fill", this.global.config.seat_style.color);
64+
this.check.hide();
6165
return this;
6266
}
6367

@@ -127,6 +131,10 @@ export class SeatItem extends SvgBase {
127131
this.addChild(this.circle);
128132

129133

134+
this.check = new SeatItemCheck(this).addTo(this);
135+
136+
137+
130138
// this.title = new SeatItemTitle(this);
131139
// this.addChild(this.title);
132140

src/lib/svg/zoom.manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export default class ZoomManager {
246246
this.zoomLevels.VENUE = {
247247
x: x,
248248
y: y,
249-
k: this.scale.k - 0.3
249+
k: this.scale.k
250250
};
251251

252252

src/scss/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
}
112112
.block-hull {
113113
stroke-linejoin: round;
114+
cursor: move;
114115
}
115116
}
116117
.masks {

0 commit comments

Comments
 (0)