Skip to content

Commit 317bcae

Browse files
committed
fix click bug
1 parent 81294b0 commit 317bcae

File tree

7 files changed

+22
-7
lines changed

7 files changed

+22
-7
lines changed

sea-modules/examples/lucky/1.0.0/main-debug.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ define("examples/lucky/1.0.0/lucky-debug", [ "jquery-debug", "jquery-easing-debu
4848
var el = $(e.target);
4949
var name = el.text();
5050
that.addItem(name);
51-
that.hit();
51+
if (trigger.getAttribute("data-action") === "start") {
52+
that.hit();
53+
}
5254
el.remove();
5355
});
5456
// bind #balls
@@ -59,6 +61,8 @@ define("examples/lucky/1.0.0/lucky-debug", [ "jquery-debug", "jquery-easing-debu
5961
var user = that.users[i];
6062
if (user.name === name) {
6163
if (!that.moveLucky() && that.luckyUser !== user) {
64+
trigger.setAttribute("data-action", "start");
65+
trigger.innerHTML = trigger.getAttribute("data-text-start");
6266
that.setLucky(user);
6367
}
6468
break;
@@ -146,6 +150,7 @@ define("examples/lucky/1.0.0/lucky-debug", [ "jquery-debug", "jquery-easing-debu
146150
user.hitMove();
147151
});
148152
if (hitCount > 0) {
153+
this.timer && clearTimeout(this.timer);
149154
this.timer = setTimeout(function() {
150155
that.hit();
151156
}, HIT_SPEED);

sea-modules/examples/lucky/1.0.0/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sea-modules/examples/lucky/1.0.0/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/lucky/dist/main-debug.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ define("examples/lucky/1.0.0/lucky-debug", [ "jquery-debug", "jquery-easing-debu
4848
var el = $(e.target);
4949
var name = el.text();
5050
that.addItem(name);
51-
that.hit();
51+
if (trigger.getAttribute("data-action") === "start") {
52+
that.hit();
53+
}
5254
el.remove();
5355
});
5456
// bind #balls
@@ -59,6 +61,8 @@ define("examples/lucky/1.0.0/lucky-debug", [ "jquery-debug", "jquery-easing-debu
5961
var user = that.users[i];
6062
if (user.name === name) {
6163
if (!that.moveLucky() && that.luckyUser !== user) {
64+
trigger.setAttribute("data-action", "start");
65+
trigger.innerHTML = trigger.getAttribute("data-text-start");
6266
that.setLucky(user);
6367
}
6468
break;
@@ -146,6 +150,7 @@ define("examples/lucky/1.0.0/lucky-debug", [ "jquery-debug", "jquery-easing-debu
146150
user.hitMove();
147151
});
148152
if (hitCount > 0) {
153+
this.timer && clearTimeout(this.timer);
149154
this.timer = setTimeout(function() {
150155
that.hit();
151156
}, HIT_SPEED);

0 commit comments

Comments
 (0)