Commit 8bcb6d23 authored by Randall Leeds's avatar Randall Leeds

Revert "Merge pull request #2123 from hypothesis/2053-scroll-sidebar-to-new-annotations-2"

This reverts commit 08d991f066e48c0388ff76ce24a611c1f553a096, reversing
changes made to d488f9c491c0334ee4f46210ba17127df169a9e6.
parent d7982a19
......@@ -42,25 +42,6 @@ describe 'thread', ->
describe 'controller', ->
it 'returns true from isNew() for a new annotation', ->
createDirective()
# When the user clicks to create a new annotation in the browser, we get
# a ThreadController with a container with a message (the annotation)
# with no id.
controller.container = {message: {}}
assert(controller.isNew())
it 'returns false from isNew() for an old annotation', ->
createDirective()
# When we create a ThreadController for an old annotation, the controller
# has a container with a message (the annotation) with an id.
controller.container = {message: {id: 123}}
assert(not controller.isNew())
describe '#toggleCollapsed', ->
count = null
......
uuid = require('node-uuid')
###*
# @ngdoc type
# @name thread.ThreadController
......@@ -138,17 +136,6 @@ ThreadController = [
return true
return @filter.check(@container)
###*
# @ngdoc method
# @name thread.ThreadController#isNew
# @description
# Return true if this is a newly-created annotation (e.g. the user has just
# created it by clicking the new annotation button in the browser),
# false otherwise.
###
this.isNew = ->
return (this.id and not this.container?.message?.id)
this._isFilterActive = ->
if @filter
@filter.active()
......@@ -161,8 +148,6 @@ ThreadController = [
else
0
this.id = uuid.v4()
this
]
......@@ -189,8 +174,8 @@ isHiddenThread = (elem) ->
# Directive that instantiates {@link thread.ThreadController ThreadController}.
###
module.exports = [
'$parse', '$window', '$location', '$anchorScroll', 'pulse', 'render',
($parse, $window, $location, $anchorScroll, pulse, render) ->
'$parse', '$window', 'pulse', 'render',
($parse, $window, pulse, render) ->
linkFn = (scope, elem, attrs, [ctrl, counter, filter]) ->
# We would ideally use require for this, but searching parents only for a
......@@ -225,10 +210,6 @@ module.exports = [
render ->
ctrl.container = thread
scope.$digest()
if ctrl.isNew()
# Scroll the sidebar to show new annotations.
$location.hash(ctrl.id)
$anchorScroll()
controller: ThreadController
controllerAs: 'vm'
......
......@@ -32,8 +32,7 @@
</ul>
</span>
</li>
<li id="{{vm.id}}"
class="paper thread"
<li class="paper thread"
ng-class="{'js-hover': hasFocus(child.message)}"
deep-count="count"
thread="child" thread-filter
......
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