]> _ Git - fluidbook-html5.git/commitdiff
#1866
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jan 2018 14:43:27 +0000 (15:43 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jan 2018 14:43:27 +0000 (15:43 +0100)
js/libs/fluidbook/fluidbook.search.js
style/fluidbook.less

index 0cb2bde313e9b1307e8f2b93435df34732cf22a5..358452aff50d33f775e0db1504a5d4de42b41c85 100644 (file)
@@ -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 = $('<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);
     },
 
index 5b16705f0bdca990bdfec305310bd390bd3db9aa..942e04d8b62012cdeb8127778ddc9046d1c82056 100644 (file)
@@ -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);
                }