Skip to content

Commit 530b2b4

Browse files
committed
clean up & comment
1 parent 7b35fff commit 530b2b4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

public/drag_drop_text/index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,22 @@
4040
$("#post").removeHighlight();
4141
}
4242

43+
4344
$(document).ready(function(){
4445
var tmp_note = $('#hidden_templates .annotation');
4546

47+
// Render existing Annotations (from pre-defined or loaded json)
48+
jQuery.each(annotations,function(){
49+
$("#dropzone").append($('<div>').annotation(this.excerpt,{insights: this.insights, comment: this.comment, template: tmp_note, available_insights: "tokens.js", onMouseOver: hilite, onMouseOut: unHilite }).fadeIn());
50+
})
51+
52+
// Add text selection handler
4653
$('#post').mouseup(function(e){
4754
var selection = getSelected();
4855
if (selection && (selection = new String(selection).replace(/^\s+|\s+$/g,''))) {
4956
$("#dropzone").append($('<div>').annotation(selection,{template: tmp_note, available_insights: "tokens.js", onMouseOver: hilite, onMouseOut: unHilite }).fadeIn());
5057
}
5158
});
52-
53-
jQuery.each(annotations,function(){
54-
$("#dropzone").append($('<div>').annotation(this.excerpt,{insights: this.insights, comment: this.comment, template: tmp_note, available_insights: "tokens.js", onMouseOver: hilite, onMouseOut: unHilite }).fadeIn());
55-
})
56-
57-
5859
});
5960

6061
</script>

0 commit comments

Comments
 (0)