--- a/src/widgets/Polemic.js Wed Apr 03 15:40:58 2013 +0200
+++ b/src/widgets/Polemic.js Wed Apr 03 15:44:17 2013 +0200
@@ -113,7 +113,7 @@
function displayAnnotation(_elx, _ely, _pol, _col, _annotation) {
var _html = Mustache.to_html(
- '<div class="Ldt-Polemic-TweetDiv Ldt-TraceMe" draggable="true" trace-info="annotation-id:{{id}}, media-id:{{media_id}}, polemic:{{polemic}}, time:{{time}}" polemic-color="{{color}}"'
+ '<div class="Ldt-Polemic-TweetDiv Ldt-TraceMe" trace-info="annotation-id:{{id}}, media-id:{{media_id}}, polemic:{{polemic}}, time:{{time}}" polemic-color="{{color}}"'
+ ' tweet-title="{{title}}" annotation-id="{{id}}" style="width: {{width}}px; height: {{height}}px; top: {{top}}px; left: {{left}}px; background: {{color}}"></div>',
{
id: _annotation.id,
@@ -134,17 +134,15 @@
_annotation.trigger("unselect");
}).click(function() {
_annotation.trigger("click");
- }).on("dragstart", function(e) {
- var url = (typeof _annotation.url !== "undefined"
- ? _annotation.url
- : (document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id));
- e.originalEvent.dataTransfer.setData("text/x-iri-title",_annotation.title);
- e.originalEvent.dataTransfer.setData("text/x-iri-description",_annotation.description);
- e.originalEvent.dataTransfer.setData("text/x-iri-uri",url);
- if (typeof _annotation.thumbnail !== "undefined" && _annotation.thumbnail) {
- e.originalEvent.dataTransfer.setData("text/x-iri-image",_annotation.thumbnail);
- }
- });
+ });
+ IriSP.attachDndData(_el, {
+ title: _annotation.title,
+ description: _annotation.description,
+ image: _annotation.thumbnail,
+ uri: (typeof _annotation.url !== "undefined"
+ ? _annotation.url
+ : (document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id))
+ });
_annotation.on("select", function() {
if (_this.tooltip) {
_this.tooltip.show(