|
@@ -25,8 +25,16 @@ function MarkBoard(option) {
|
|
|
this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
|
|
|
this.initByTask(context.task);
|
|
|
});
|
|
|
- this.markControl.on('mark.track.set', this, function(event, context, track) {
|
|
|
- if(track != undefined && this.currentStep != undefined && this.currentStep.currentScore != undefined) {
|
|
|
+ this.markControl.on('special.tag.enable', this, function(event, context, eventObject) {
|
|
|
+ this.specialTag=true;
|
|
|
+ });
|
|
|
+ this.markControl.on('special.tag.disable', this, function(event, context, eventObject) {
|
|
|
+ this.specialTag=false;
|
|
|
+ });
|
|
|
+ this.markControl.on('image.click.event', this, function(event, context, track) {
|
|
|
+ if(track != undefined && this.currentStep != undefined
|
|
|
+ && this.currentStep.currentScore != undefined
|
|
|
+ && this.specialTag!=true) {
|
|
|
track.score = this.currentStep.currentScore;
|
|
|
track.questionNumber = this.currentStep.questionNumber;
|
|
|
track.number = this.currentStep.trackList.length + 1;
|
|
@@ -34,9 +42,26 @@ function MarkBoard(option) {
|
|
|
this.resetScore();
|
|
|
this.updateStepScore();
|
|
|
this.trySetScore(track.score);
|
|
|
- this.markControl.trigger('mark.track.show', track);
|
|
|
+ this.markControl.trigger('mark.tag.show', {
|
|
|
+ content: track.score,
|
|
|
+ positionX: track.positionX,
|
|
|
+ positionY: track.positionY
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
+ //图片重新加载后,恢复显示所有标记
|
|
|
+ this.markControl.on('image.reload.event', this, function(event, context, eventObject) {
|
|
|
+ for(var i = 0; i < this.stepList.length; i++) {
|
|
|
+ var step = this.stepList[i];
|
|
|
+ for(var j = 0; j < step.trackList.length; j++) {
|
|
|
+ this.markControl.trigger('mark.tag.show', {
|
|
|
+ content: step.trackList[j].score,
|
|
|
+ positionX: step.trackList[j].positionX,
|
|
|
+ positionY: step.trackList[j].positionY
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
this.markControl.on('key.press', this, function(e, context, event) {
|
|
|
var code = event.keyCode;
|
|
|
//console.log('key press:' + code);
|
|
@@ -83,7 +108,6 @@ MarkBoard.prototype.init = function() {
|
|
|
self.currentStep.trackList.pop();
|
|
|
self.updateStepScore();
|
|
|
self.refreshTrack();
|
|
|
- //self.markControl.trigger('mark.track.clear');
|
|
|
}
|
|
|
});
|
|
|
this.stepBoard.find('.clear-current-track-button').click(this, function() {
|
|
@@ -92,7 +116,6 @@ MarkBoard.prototype.init = function() {
|
|
|
self.currentStep.trackList = [];
|
|
|
self.updateStepScore();
|
|
|
self.refreshTrack();
|
|
|
- //self.markControl.trigger('mark.track.clear');
|
|
|
}
|
|
|
});
|
|
|
this.stepBoard.find('.clear-all-track-button').click(this, function() {
|
|
@@ -103,7 +126,6 @@ MarkBoard.prototype.init = function() {
|
|
|
self.updateStepScore(self.stepList[i]);
|
|
|
}
|
|
|
self.refreshTrack();
|
|
|
- //self.markControl.trigger('mark.track.clear');
|
|
|
}
|
|
|
});
|
|
|
var dom5 = this.stepBoard.find(".sublist");
|
|
@@ -228,10 +250,6 @@ MarkBoard.prototype.onStepSelect = function(stepNumber) {
|
|
|
self.onScoreClick($(this).attr('data-number'));
|
|
|
});
|
|
|
}
|
|
|
- //this.markControl.trigger('mark.track.clear');
|
|
|
- //for(var i = 0; i < this.currentStep.trackList.length; i++) {
|
|
|
- // this.markControl.trigger('mark.track.show', this.currentStep.trackList[i]);
|
|
|
- //}
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -312,13 +330,7 @@ MarkBoard.prototype.refreshTrack = function() {
|
|
|
if(this.stepList == undefined) {
|
|
|
return;
|
|
|
}
|
|
|
- this.markControl.trigger('mark.track.clear');
|
|
|
- for(var i = 0; i < this.stepList.length; i++) {
|
|
|
- var step = this.stepList[i];
|
|
|
- for(var j = 0; j < step.trackList.length; j++) {
|
|
|
- this.markControl.trigger('mark.track.show', step.trackList[j]);
|
|
|
- }
|
|
|
- }
|
|
|
+ this.markControl.trigger('mark.tag.clear');
|
|
|
}
|
|
|
|
|
|
MarkBoard.prototype.updateStepScore = function(step) {
|