image_annotation/commit
Put on hover over autocompleten in comment, at the moment it doesnt add much (should start specifying scopenotes?).
author | Chris Dijkshoorn |
---|---|
Mon Mar 30 20:44:06 2015 +0100 | |
committer | Chris Dijkshoorn |
Mon Mar 30 20:44:06 2015 +0100 | |
commit | 7a4866a4b1a742889c42b08d1c4c519ea39aac9c |
tree | e738c0aeeeaa0b4e12d823323dbc7eced8845de2 |
parent | 64a31ef7f4ae94f618a12dfa231e15a2b8c5be7f |
Diff style: patch stat
diff --git a/web/js/annotation.js b/web/js/annotation.js index 84d2854..c9a1886 100644 --- a/web/js/annotation.js +++ b/web/js/annotation.js @@ -85,10 +85,10 @@ YUI.add('annotation', function(Y) { // infoNode is the overlay with tooltips when hovering over suggested terms - this.infoNode = new Y.Overlay({}).render(parentNode); - this.on("activeItemChange", this.onSuggestionHover, this); - this.on("hoveredItemChange", this.onSuggestionHover, this); - +// this.infoNode = new Y.Overlay({}).render(parentNode); +// this.on("activeItemChange", this.onSuggestionHover, this); +// this.on("hoveredItemChange", this.onSuggestionHover, this); + // create overlays for comments on delete and add actions: this.createCommentNode(parentNode); if (this.enabled('deleteCommentEnabled', null)) { @@ -611,35 +611,35 @@ YUI.add('annotation', function(Y) { } ); }, - onSuggestionHover : function(ev) { - var infoNode = this.infoNode, - active = ev.newVal, - body = ''; - if(active && active.getData().result.raw.info) { - var scope = active.getData().result.raw.info.scopeNotes[0]; - var defin = active.getData().result.raw.info.definitions[0]; - var alts = active.getData().result.raw.info.altLabels; - var img = active.getData().result.raw.info.images[0]; - if (scope && scope.en) { body += "<div class='scope'>"+scope.en+"</div>"; } - if (defin && defin.en) { body += "<div class='defin'>"+defin.en+"</div>"; } - if (img) { body += "<img class='depiction' src='"+img+"'>"; } - for (var i=0; i<alts.length; i++) { - body += "<span class='altLabel'>" +alts[i] + "</span>" ; - } - } - if(body) { - var ratio = ev.newVal.getX()/window.innerWidth; - if (ratio < 0.4) { // make suggestions appear on the left or the right: - infoNode.set("align", {node:active, points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]}); - } else { - infoNode.set("align", {node:active, points:[Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.TL]}); - } - infoNode.set("bodyContent", body); - infoNode.show(); - } else { - infoNode.hide(); - } - }, +// onSuggestionHover : function(ev) { +// var infoNode = this.infoNode, +// active = ev.newVal, +// body = ''; +// if(active && active.getData().result.raw.info) { +// var scope = active.getData().result.raw.info.scopeNotes[0]; +// var defin = active.getData().result.raw.info.definitions[0]; +// var alts = active.getData().result.raw.info.altLabels; +// var img = active.getData().result.raw.info.images[0]; +// if (scope && scope.en) { body += "<div class='scope'>"+scope.en+"</div>"; } +// if (defin && defin.en) { body += "<div class='defin'>"+defin.en+"</div>"; } +// if (img) { body += "<img class='depiction' src='"+img+"'>"; } +// for (var i=0; i<alts.length; i++) { +// body += "<span class='altLabel'>" +alts[i] + "</span>" ; +// } +// } +// if(body) { +// var ratio = ev.newVal.getX()/window.innerWidth; +// if (ratio < 0.4) { // make suggestions appear on the left or the right: +// infoNode.set("align", {node:active, points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]}); +// } else { +// infoNode.set("align", {node:active, points:[Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.TL]}); +// } +// infoNode.set("bodyContent", body); +// infoNode.show(); +// } else { +// infoNode.hide(); +// } +// }, onItemSelect : function(ev, next) { // Y.log('onItemSelect'); if (ev.preventDefault) ev.preventDefault();