Commit 02b13e2f authored by Jake Hartnell's avatar Jake Hartnell Committed by Randall Leeds

Clean up code. Remove hacky stuff.

parent 82591e48
...@@ -49,7 +49,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -49,7 +49,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
state = not @annotator.visibleHighlights state = not @annotator.visibleHighlights
@annotator.setVisibleHighlights state @annotator.setVisibleHighlights state
, ,
## TODO: if we are going to allow highlighting on mobile we should showe this button on a selection (mobile only) ## TODO: if we are going to allow highlighting on mobile we should show this button on a selection (mobile only).
# "title": "Highlighting Mode" # "title": "Highlighting Mode"
# "class": "h-icon-highlighter" # "class": "h-icon-highlighter"
# "on": # "on":
......
...@@ -46,7 +46,6 @@ AnnotationController = [ ...@@ -46,7 +46,6 @@ AnnotationController = [
@timestamp = null @timestamp = null
model = $scope.annotationGet() model = $scope.annotationGet()
highlight = model.$highlight
original = null original = null
vm = this vm = this
...@@ -64,8 +63,11 @@ AnnotationController = [ ...@@ -64,8 +63,11 @@ AnnotationController = [
# @returns {boolean} True if the annotation is a highlight. # @returns {boolean} True if the annotation is a highlight.
### ###
this.isHighlight = -> this.isHighlight = ->
if model.id
model.target?.length and not model.references?.length and model.target?.length and not model.references?.length and
not (model.text or model.deleted or model.tags?.length) not (model.text or model.deleted or model.tags?.length)
else
model.$highlight
###* ###*
# @ngdoc method # @ngdoc method
...@@ -265,13 +267,11 @@ AnnotationController = [ ...@@ -265,13 +267,11 @@ AnnotationController = [
$scope.$emit('annotationUpdate') $scope.$emit('annotationUpdate')
# Save highlights once logged in. # Save highlights once logged in.
if highlight and this.isHighlight() if this.isHighlight()
if model.user and not model.id if model.user and not model.id
highlight = false # skip this on future updates
model.permissions = permissions.private() model.permissions = permissions.private()
model.$create().then -> model.$create().then ->
$rootScope.$emit('annotationCreated', model) $rootScope.$emit('annotationCreated', model)
highlight = false # skip this on future updates
else else
drafts.add model, => this.revert() drafts.add model, => this.revert()
...@@ -280,7 +280,7 @@ AnnotationController = [ ...@@ -280,7 +280,7 @@ AnnotationController = [
, true , true
# Start editing brand new annotations immediately # Start editing brand new annotations immediately
unless model.id? or (highlight and this.isHighlight()) then this.edit() unless model.id? or this.isHighlight() then this.edit()
this this
] ]
......
@import "./mixins/icons"; @import "./mixins/icons";
/* HACKY THINGS */
@import url(https://fonts.googleapis.com/css?family=Lato:400,300,300italic);
html, body {
font-family: "lato", sans-serif !important;
}
/* / HACKY THINGS */
.help-page { .help-page {
padding-top: 2.5em; padding-top: 2.5em;
padding-bottom: 2.5em; padding-bottom: 2.5em;
......
...@@ -19,7 +19,6 @@ $base-font-size: 14px; ...@@ -19,7 +19,6 @@ $base-font-size: 14px;
position: absolute; position: absolute;
border: 4px solid $border; border: 4px solid $border;
border-radius: 4px; border-radius: 4px;
// width: 40px;
z-index: 999; z-index: 999;
&:before { &:before {
...@@ -51,7 +50,7 @@ $base-font-size: 14px; ...@@ -51,7 +50,7 @@ $base-font-size: 14px;
padding: 0; padding: 0;
text-align: center; text-align: center;
background: white !important; background: white !important;
color: $border !important; color: $gray-light !important;
&::-moz-focus-inner { &::-moz-focus-inner {
border: 0; border: 0;
...@@ -227,7 +226,7 @@ $base-font-size: 14px; ...@@ -227,7 +226,7 @@ $base-font-size: 14px;
left: -1px; left: -1px;
position: absolute; position: absolute;
color: fade-out($text-color, .75); color: $gray-light;
text-decoration: none; text-decoration: none;
} }
......
...@@ -35,7 +35,7 @@ $link-color-hover: $hypothered !default; ...@@ -35,7 +35,7 @@ $link-color-hover: $hypothered !default;
// Typography // Typography
// ------------------------- // -------------------------
$sans-font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif !default; $sans-font-family: "Lato","Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif !default;
$serif-font-family: Georgia, "Bitstream Charter", "Times", "Times New Roman", serif !default; $serif-font-family: Georgia, "Bitstream Charter", "Times", "Times New Roman", serif !default;
$mono-font-family: Open Sans Mono, Menlo, DejaVu Sans Mono, monospace !default; $mono-font-family: Open Sans Mono, Menlo, DejaVu Sans Mono, monospace !default;
......
<a href="" <a href=""
class="threadexp" class="threadexp"
title="{{vm.collapsed && 'Expand' || 'Collapse'}}"> title="{{vm.collapsed && 'Expand' || 'Collapse'}}"
ng-click="vm.toggleCollapsed()">
<span ng-class="{'h-icon-expand-more': !!vm.collapsed, <span ng-class="{'h-icon-expand-more': !!vm.collapsed,
'h-icon-expand-less': !vm.collapsed}"></span> 'h-icon-expand-less': !vm.collapsed}"></span>
</a> </a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment