Commit ef706f43 authored by csillag's avatar csillag

Renamed a few methods to be more consistent

(As previously discussed with @tilgovi)

Sidebar -> Document RPC methods:
 * Renamed `scrollTo()` to `scrollToAnnotation()` (to be consistent with `focusAnnotations()`

Guest methods:
 * Renamed `showViewer()` to `showAnnotations()` (to be consistend with `focusAnnotations()`)
 * Renamed `updateViewer()` to `updateAnnotations()` (same reason)
 * Renamed `toggleVIewerSelection()` to `toggleAnnotationSelection()` (same reason)
parent 4891c90b
...@@ -344,7 +344,7 @@ class ViewerController ...@@ -344,7 +344,7 @@ class ViewerController
if angular.isObject annotation if angular.isObject annotation
for p in annotator.providers for p in annotator.providers
p.channel.notify p.channel.notify
method: 'scrollTo' method: 'scrollToAnnotation'
params: annotation.$$tag params: annotation.$$tag
$scope.shouldShowThread = (container) -> $scope.shouldShowThread = (container) ->
......
...@@ -151,7 +151,7 @@ class Annotator.Guest extends Annotator ...@@ -151,7 +151,7 @@ class Annotator.Guest extends Annotator
hl.setFocused false hl.setFocused false
) )
.bind('scrollTo', (ctx, tag) => .bind('scrollToAnnotation', (ctx, tag) =>
for hl in @getHighlights() for hl in @getHighlights()
if hl.annotation.$$tag is tag if hl.annotation.$$tag is tag
hl.scrollTo() hl.scrollTo()
...@@ -228,17 +228,17 @@ class Annotator.Guest extends Annotator ...@@ -228,17 +228,17 @@ class Annotator.Guest extends Annotator
this.plugins.Bridge.sync([annotation]) this.plugins.Bridge.sync([annotation])
annotation annotation
showViewer: (annotations) => showAnnotations: (annotations) =>
@panel?.notify @panel?.notify
method: "showViewer" method: "showViewer"
params: (a.$$tag for a in annotations) params: (a.$$tag for a in annotations)
toggleViewerSelection: (annotations) => toggleAnnotationSelection: (annotations) =>
@panel?.notify @panel?.notify
method: "toggleViewerSelection" method: "toggleViewerSelection"
params: (a.$$tag for a in annotations) params: (a.$$tag for a in annotations)
updateViewer: (annotations) => updateAnnotations: (annotations) =>
@panel?.notify @panel?.notify
method: "updateViewer" method: "updateViewer"
params: (a.$$tag for a in annotations) params: (a.$$tag for a in annotations)
...@@ -290,10 +290,10 @@ class Annotator.Guest extends Annotator ...@@ -290,10 +290,10 @@ class Annotator.Guest extends Annotator
if toggle if toggle
# Tell sidebar to add these annotations to the sidebar # Tell sidebar to add these annotations to the sidebar
this.toggleViewerSelection annotations this.toggleAnnotationSelection annotations
else else
# Tell sidebar to show the viewer for these annotations # Tell sidebar to show the viewer for these annotations
this.showViewer annotations this.showAnnotations annotations
# When hovering on a highlight in highlighting mode, # When hovering on a highlight in highlighting mode,
# tell the sidebar to hilite the relevant annotations # tell the sidebar to hilite the relevant annotations
......
...@@ -351,7 +351,7 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin ...@@ -351,7 +351,7 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
this._buildTabs(@tabs, @buckets) this._buildTabs(@tabs, @buckets)
if @dynamicBucket if @dynamicBucket
@annotator.updateViewer this._getDynamicBucket() @annotator.updateAnnotations this._getDynamicBucket()
_buildTabs: -> _buildTabs: ->
@tabs.each (d, el) => @tabs.each (d, el) =>
...@@ -395,4 +395,4 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin ...@@ -395,4 +395,4 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
# Simulate clicking on the comments tab # Simulate clicking on the comments tab
commentClick: => commentClick: =>
@dynamicBucket = false @dynamicBucket = false
annotator.showViewer @buckets[@_getCommentBucket()] annotator.showAnnotations @buckets[@_getCommentBucket()]
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