Style cleanup

This commit is contained in:
Rainer Simon 2020-04-04 15:50:47 +02:00
parent 8e857ba9d7
commit 761794054e
9 changed files with 15 additions and 21 deletions

View File

@ -23,11 +23,11 @@ const Comment = props => {
} }
return props.readOnly ? ( return props.readOnly ? (
<div className="r6o-section comment"> <div className="r6o-widget comment">
{props.body.value} {props.body.value}
</div> </div>
) : ( ) : (
<div className={ isEditable ? "r6o-section comment editable" : "r6o-section comment"}> <div className={ isEditable ? "r6o-widget comment editable" : "r6o-widget comment"}>
<TextEntryField <TextEntryField
editable={isEditable} editable={isEditable}
content={props.body.value} content={props.body.value}

View File

@ -25,7 +25,7 @@ const CommentWidget = props => {
)} )}
{ !props.readOnly && props.annotation && { !props.readOnly && props.annotation &&
<div className="r6o-section comment editable"> <div className="r6o-widget comment editable">
<TextEntryField <TextEntryField
content={props.currentReply} content={props.currentReply}
editable={true} editable={true}

View File

@ -34,14 +34,14 @@ export default class Highlighter {
_findAnnotationSpans = annotation => { _findAnnotationSpans = annotation => {
// TODO index annotation to make this faster // TODO index annotation to make this faster
const allAnnotationSpans = document.querySelectorAll('.annotation'); const allAnnotationSpans = document.querySelectorAll('.r6o-annotation');
return Array.prototype.slice.call(allAnnotationSpans) return Array.prototype.slice.call(allAnnotationSpans)
.filter(span => span.annotation.isEqual(annotation)); .filter(span => span.annotation.isEqual(annotation));
} }
getAllAnnotations = () => { getAllAnnotations = () => {
// TODO index annotation to make this faster // TODO index annotation to make this faster
const allAnnotationSpans = document.querySelectorAll('.annotation'); const allAnnotationSpans = document.querySelectorAll('.r6o-annotation');
return Array.prototype.slice.call(allAnnotationSpans) return Array.prototype.slice.call(allAnnotationSpans)
.map(span => span.annotation); .map(span => span.annotation);
} }
@ -80,7 +80,7 @@ export default class Highlighter {
applyStyles = (annotation, spans) => { applyStyles = (annotation, spans) => {
const extraClasses = this.formatter ? this.formatter(annotation) : ''; const extraClasses = this.formatter ? this.formatter(annotation) : '';
spans.forEach(span => span.className = `annotation ${extraClasses}`.trim()); spans.forEach(span => span.className = `r6o-annotation ${extraClasses}`.trim());
} }
bindAnnotation = (annotation, elements) => { bindAnnotation = (annotation, elements) => {
@ -245,7 +245,7 @@ export default class Highlighter {
annotations.push(element.annotation); annotations.push(element.annotation);
return (parent.classList.contains('annotation')) ? return (parent.classList.contains('r6o-annotation')) ?
getAnnotationsRecursive(parent, annotations) : annotations; getAnnotationsRecursive(parent, annotations) : annotations;
}, },

View File

@ -37,7 +37,7 @@ export default class SelectionHandler extends EventEmitter {
const selection = getSelection(); const selection = getSelection();
if (selection.isCollapsed) { if (selection.isCollapsed) {
const annotationSpan = evt.target.closest('.annotation'); const annotationSpan = evt.target.closest('.r6o-annotation');
if (annotationSpan) { if (annotationSpan) {
this.emit('select', { this.emit('select', {
selection: this.highlighter.getAnnotationsAt(annotationSpan)[0], selection: this.highlighter.getAnnotationsAt(annotationSpan)[0],

View File

@ -1,3 +1,4 @@
@import "widgets/textentry";
@import "widgets/comment/comment"; @import "widgets/comment/comment";
@import "widgets/tag/tag"; @import "widgets/tag/tag";
@import "widgets/type/typeSelector"; @import "widgets/type/typeSelector";
@ -35,11 +36,11 @@
@include rounded-corners(2px); @include rounded-corners(2px);
@include box-shadow(2px, 2px, 42px, 0.4); @include box-shadow(2px, 2px, 42px, 0.4);
.r6o-section:first-child { .r6o-widget:first-child {
@include rounded-corners-top(2px); @include rounded-corners-top(2px);
} }
.r6o-section { .r6o-widget {
border-bottom:1px solid $lightgrey-border-darker; border-bottom:1px solid $lightgrey-border-darker;
} }
} }

View File

@ -1,4 +1,4 @@
.r6o-section.comment { .r6o-widget.comment {
font-size:14px; font-size:14px;
min-height:3em; min-height:3em;
background-color:#fff; background-color:#fff;
@ -56,6 +56,6 @@
} }
.r6o-section.comment.editable { .r6o-widget.comment.editable {
background-color:$blueish-white; background-color:$blueish-white;
} }

View File

@ -1,4 +1,3 @@
@import "includes/colors"; @import "includes/colors";
@import "includes/fonts";
@import "includes/mixins"; @import "includes/mixins";
@import "includes/buttons"; @import "includes/buttons";

View File

@ -1,6 +0,0 @@
@font-face {
font-family:'FontAwesome';
src:url('/fontawesome-webfont.ttf');
font-weight:normal;
font-style:normal;
}

View File

@ -1,10 +1,10 @@
.annotation { .r6o-annotation {
background-color:#ffa50033; background-color:#ffa50033;
border-bottom:2px solid orange; border-bottom:2px solid orange;
cursor:pointer; cursor:pointer;
} }
.selection { .r6o-selection {
background-color:#cfcfffa1; background-color:#cfcfffa1;
cursor:pointer; cursor:pointer;
} }