Skip to content

Commit 5920eee

Browse files
author
Kevin Meyer
committed
INT-727 Implement feature tour
fixed problem with event delegation and clicking slightly off the target element, removed some redundant code
1 parent 8494bb7 commit 5920eee

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/tour/index.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,23 @@ var TourView = View.extend({
3030
that.$featuresLI[that.tourCount].className = '';
3131

3232
if (that.tourCount == 4) {
33-
// do last
3433
that.tourCount = 0;
35-
that.$featuresLI[that.tourCount].className = 'selected';
36-
that.$animationGIF.src = that.tourImagesFolder + that.tourImages [that.tourCount];
3734
} else {
38-
// advance
3935
that.tourCount++;
40-
that.$featuresLI[that.tourCount].className = 'selected';
41-
that.$animationGIF.src = that.tourImagesFolder + that.tourImages [that.tourCount];
4236
}
37+
that.$featuresLI[that.tourCount].className = 'selected';
38+
that.$animationGIF.src = that.tourImagesFolder + that.tourImages [that.tourCount];
4339
}, 1000 * 7);
4440
},
4541

4642
showFeature: function(ev) {
47-
var nFeature = parseInt(ev.target.getAttribute ('data-n'), 2);
43+
var nCLick = ev.target.getAttribute ('data-n');
44+
if (nCLick == null) {
45+
return false;
46+
}
47+
var nFeature = parseInt(nCLick, 10);
4848
this.$featuresLI[this.tourCount].className = '';
4949
ev.target.className = 'selected';
50-
this.$tourRemove.className = 'btn btn-primary';
5150
this.$animationGIF.src = this.tourImagesFolder + ev.target.id + '.gif';
5251
this.tourCount = nFeature;
5352
clearInterval(this.playAuto);

src/tour/index.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
width: 80%;
2525
max-width: 925px;
26-
// height: 420px;
2726
position: absolute;
2827
background-color: white;
2928
border-radius: 9px;
@@ -70,7 +69,7 @@
7069
li.selected {
7170
color: #24b8eb;
7271
background-image: url(images/tour/tour-selected.png);
73-
background-size: 25px 20px;
72+
background-size: 26px 20px;
7473
background-repeat: no-repeat;
7574
background-position: 0px 4px;
7675
}

0 commit comments

Comments
 (0)