Commit 72e1cde6 authored by Robert Knight's avatar Robert Knight

Disable the post button when the annotation has no content

Card 89
parent fb34c3e4
...@@ -133,6 +133,15 @@ AnnotationController = [ ...@@ -133,6 +133,15 @@ AnnotationController = [
else if privacy == 'shared' else if privacy == 'shared'
this.setShared() this.setShared()
###*
# @ngdoc method
# @name annotation.AnnotaitonController#hasContent
# @returns {boolean} True if the currently edited annotation has
# content (ie. is not just a highlight)
###
this.hasContent = ->
@annotation.text?.length > 0 || @annotation.tags?.length > 0
###* ###*
# @ngdoc method # @ngdoc method
# @name annotation.AnnotationController#authorize # @name annotation.AnnotationController#authorize
......
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
class="dropdown-menu-btn"><i class="h-icon-check btn-icon"></i> Delete</button> class="dropdown-menu-btn"><i class="h-icon-check btn-icon"></i> Delete</button>
<publish-annotation-btn <publish-annotation-btn
group="vm.group()" group="vm.group()"
can-post="vm.hasContent()"
is-new="vm.action == 'create'" is-new="vm.action == 'create'"
is-shared="vm.isShared()" is-shared="vm.isShared()"
on-save="vm.save()" on-save="vm.save()"
......
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