diff --git a/h/static/scripts/app.coffee b/h/static/scripts/app.coffee index 47dfad07cc7..88c6e654a2b 100644 --- a/h/static/scripts/app.coffee +++ b/h/static/scripts/app.coffee @@ -147,7 +147,6 @@ module.exports = angular.module('h', [ .service('host', require('./host')) .service('localStorage', require('./local-storage')) .service('permissions', require('./permissions')) -.service('pulse', require('./pulse')) .service('queryParser', require('./query-parser')) .service('render', require('./render')) .service('searchFilter', require('./search-filter')) diff --git a/h/static/scripts/directive/annotation.coffee b/h/static/scripts/directive/annotation.coffee index b7afd99614f..5325e99ead9 100644 --- a/h/static/scripts/directive/annotation.coffee +++ b/h/static/scripts/directive/annotation.coffee @@ -387,11 +387,6 @@ AnnotationController = [ # Discard saved drafts drafts.remove model - # Propagate an update event up the thread (to pulse changing threads), - # but only if this is someone else's annotation. - if model.user != session.state.userid - $scope.$emit('annotationUpdate') - # Save highlights once logged in. if this.isHighlight() and highlight if model.user and not model.id diff --git a/h/static/scripts/directive/test/annotation-test.coffee b/h/static/scripts/directive/test/annotation-test.coffee index d666e98570d..4452c66160e 100644 --- a/h/static/scripts/directive/test/annotation-test.coffee +++ b/h/static/scripts/directive/test/annotation-test.coffee @@ -486,24 +486,6 @@ describe 'annotation', -> $document.click() assert.notOk(dialog.hasClass('open')) - describe 'annotationUpdate event', -> - beforeEach -> - createDirective() - sandbox.spy(isolateScope, '$emit') - annotation.updated = '123' - $scope.$digest() - - it "does not fire when this user's annotations are updated", -> - annotation.updated = '456' - $scope.$digest() - assert.notCalled(isolateScope.$emit) - - it "fires when another user's annotation is updated", -> - fakeSession.state.userid = 'acct:jane@localhost' - annotation.updated = '456' - $scope.$digest() - assert.calledWith(isolateScope.$emit, 'annotationUpdate') - describe "deleteAnnotation() method", -> before -> sinon.stub(window, "confirm") diff --git a/h/static/scripts/directive/test/thread-test.coffee b/h/static/scripts/directive/test/thread-test.coffee index 0287b78cc2b..722bc796577 100644 --- a/h/static/scripts/directive/test/thread-test.coffee +++ b/h/static/scripts/directive/test/thread-test.coffee @@ -6,7 +6,6 @@ describe 'thread', -> $scope = null controller = null fakeGroups = null - fakePulse = null fakeRender = null fakeAnnotationUI = null sandbox = null @@ -29,7 +28,6 @@ describe 'thread', -> fakeGroups = { focused: sandbox.stub().returns({id: '__world__'}) } - fakePulse = sandbox.spy() fakeRender = sandbox.spy() fakeAnnotationUI = { hasSelectedAnnotations: -> @@ -38,7 +36,6 @@ describe 'thread', -> selectedAnnotations.indexOf(id) != -1 } $provide.value 'groups', fakeGroups - $provide.value 'pulse', fakePulse $provide.value 'render', fakeRender $provide.value 'annotationUI', fakeAnnotationUI return @@ -351,31 +348,3 @@ describe 'thread', -> controller.container = {} assert.isFalse(controller.matchesFilter()) assert.calledWith(check, controller.container) - - describe 'directive', -> - beforeEach -> - createDirective() - - it 'pulses the current thread on an annotationUpdated event', -> - $element.scope().$emit('annotationUpdate') - assert.called(fakePulse) - - it 'does not pulse the thread if it is hidden (parent collapsed)', -> - fakeParent = { - controller: -> {collapsed: true} - } - sandbox.stub(angular.element.prototype, 'parent').returns(fakeParent) - $element.scope().$emit('annotationUpdate') - assert.notCalled(fakePulse) - - it 'does not pulse the thread if it is hidden (grandparent collapsed)', -> - fakeGrandParent = { - controller: -> {collapsed: true} - } - fakeParent = { - controller: -> {collapsed: false} - parent: -> fakeGrandParent - } - sandbox.stub(angular.element.prototype, 'parent').returns(fakeParent) - $element.scope().$emit('annotationUpdate') - assert.notCalled(fakePulse) diff --git a/h/static/scripts/directive/thread.coffee b/h/static/scripts/directive/thread.coffee index 6268830f16b..b42c0383b28 100644 --- a/h/static/scripts/directive/thread.coffee +++ b/h/static/scripts/directive/thread.coffee @@ -219,8 +219,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', '$location', '$anchorScroll', 'render', + ($parse, $window, $location, $anchorScroll, render) -> linkFn = (scope, elem, attrs, [ctrl, counter, filter]) -> # We would ideally use require for this, but searching parents only for a @@ -239,15 +239,6 @@ module.exports = [ counter.count 'message', 1 scope.$on '$destroy', -> counter.count 'message', -1 - # Flash the thread when any child annotations are updated. - scope.$on 'annotationUpdate', (event) -> - # If we're hidden, we let the event propagate up to the parent thread. - if isHiddenThread(elem) - return - # Otherwise, stop the event from bubbling, and pulse this thread. - event.stopPropagation() - pulse(elem) - # The watch is necessary because the computed value of the attribute # expression may change. This won't happen when we use the thread # directive in a repeat, since the element will be torn down whenever the diff --git a/h/static/scripts/pulse.coffee b/h/static/scripts/pulse.coffee deleted file mode 100644 index 0a171fb362b..00000000000 --- a/h/static/scripts/pulse.coffee +++ /dev/null @@ -1,12 +0,0 @@ -###* -# @ngdoc service -# @name pulse -# @param {Element} elem Element to pulse. -# @description -# Pulses an element to indicate activity in that element. -### -module.exports = ['$animate', ($animate) -> - (elem) -> - $animate.addClass elem, 'pulse', -> - $animate.removeClass(elem, 'pulse') -] diff --git a/h/static/styles/threads.scss b/h/static/styles/threads.scss index bb750a13350..5fcc760eb41 100644 --- a/h/static/styles/threads.scss +++ b/h/static/styles/threads.scss @@ -28,14 +28,6 @@ $thread-padding: 1em; margin-left: -$thread-padding; } - @keyframes pulse { - 10% { background-color: #ffc; } - } - - &.pulse { - animation: pulse 1200ms ease-in-out; - } - .thread { border-left: 1px dotted $gray-light; padding: 0;