continue;
}
-
if (this.fluidbook.datas.searchWordSelectionAlgorithm == 'begins' && w.indexOf(term) != 0) {
continue;
} else if (this.fluidbook.datas.searchWordSelectionAlgorithm == 'contains' && w.indexOf(term) == -1) {
continue;
}
+
var h = {occurences: HIGHLIGHTS[w], color: t, word: w, term: term};
this.highlights.push(h);
}
var z = this.fluidbook.datas.cssScale;
var h = $('<div class="highlight" data-color="' + color + '"></div>');
var coords = {top: (position.y - position.height - padding * 2) * z, left: (position.x + x - padding) * z + offset, width: (width + 2 * padding) * z, height: (position.height + padding * 3) * z};
+ var transform = {};
+ if (position.rotation) {
+ transform.rotate = -position.rotation + 'deg';
+ }
var hash = coords.top + '|' + coords.left + '|' + coords.width + '|' + coords.height;
if ($('[data-hash="' + hash + '"]').length > 0) {
return;
}
$(h).attr('data-hash', hash);
- $(h).css(coords);
+ $(h).css(coords).transform(transform);
$("#searchHighlights").append(h);
},
border-width: 2px;
border-radius: 2px;
border-style: solid;
+
+ -webkit-transform-origin: 0 0;
+ -moz-transform-origin: 0 0;
+ transform-origin: 0 0;
+
&[data-color="0"], &[data-color="5"], &[data-color="10"] {
.highlight-area(#00ff00);
}