From: Vincent Vanwaelscappel Date: Tue, 9 Jan 2018 14:43:27 +0000 (+0100) Subject: #1866 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5b3c1e6f06c0b75dfb218384527f4202c43ae620;p=fluidbook-html5.git #1866 --- diff --git a/js/libs/fluidbook/fluidbook.search.js b/js/libs/fluidbook/fluidbook.search.js index 0cb2bde3..358452af 100644 --- a/js/libs/fluidbook/fluidbook.search.js +++ b/js/libs/fluidbook/fluidbook.search.js @@ -204,7 +204,6 @@ FluidbookSearch.prototype = { continue; } - if (this.fluidbook.datas.searchWordSelectionAlgorithm == 'begins' && w.indexOf(term) != 0) { continue; } else if (this.fluidbook.datas.searchWordSelectionAlgorithm == 'contains' && w.indexOf(term) == -1) { @@ -213,6 +212,7 @@ FluidbookSearch.prototype = { continue; } + var h = {occurences: HIGHLIGHTS[w], color: t, word: w, term: term}; this.highlights.push(h); } @@ -297,12 +297,16 @@ FluidbookSearch.prototype = { var z = this.fluidbook.datas.cssScale; var h = $('
'); 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); }, diff --git a/style/fluidbook.less b/style/fluidbook.less index 5b16705f..942e04d8 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -352,6 +352,11 @@ body, html { 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); }