Remove inapropiate use of block comments on common/attachments.coffee

stable
Andrey Antukh 2014-09-01 15:57:13 +02:00
parent f5df8387bf
commit 0afb4d6938
1 changed files with 0 additions and 18 deletions

View File

@ -34,9 +34,7 @@ AttachmentsDirective = ($repo, $rs, $confirm) ->
$ctrl = $el.controller() $ctrl = $el.controller()
$scope.uploadingFiles = [] $scope.uploadingFiles = []
###########
## Drag & drop ## Drag & drop
###########
tdom = $el.find("div.attachment-body.sortable") tdom = $el.find("div.attachment-body.sortable")
tdom.sortable({ tdom.sortable({
@ -67,15 +65,11 @@ AttachmentsDirective = ($repo, $rs, $confirm) ->
attach.revert() attach.revert()
_.sorBy($scope.attachments, 'order') _.sorBy($scope.attachments, 'order')
###########
## Total attachments counter ## Total attachments counter
###########
$scope.$watch "attachmentsCount", (count) -> $scope.$watch "attachmentsCount", (count) ->
$el.find("span.attachments-num").html(count) $el.find("span.attachments-num").html(count)
###########
## Show/Hide deprecated attachments ## Show/Hide deprecated attachments
###########
$scope.showDeprecatedAttachments = false $scope.showDeprecatedAttachments = false
$scope.$watch "deprecatedAttachmentsCount", (deprecatedAttachmentsCount) -> $scope.$watch "deprecatedAttachmentsCount", (deprecatedAttachmentsCount) ->
@ -101,9 +95,7 @@ AttachmentsDirective = ($repo, $rs, $confirm) ->
.prop("title", "show deprecated attachments") # TODO: i18n .prop("title", "show deprecated attachments") # TODO: i18n
$el.find("div.single-attachment.deprecated").addClass("hidden") $el.find("div.single-attachment.deprecated").addClass("hidden")
###########
## Add Attachments ## Add Attachments
###########
$el.on "click", "a.add-attach", -> $el.on "click", "a.add-attach", ->
event.preventDefault() event.preventDefault()
angular.element("input.add-attach").trigger("click") angular.element("input.add-attach").trigger("click")
@ -139,9 +131,7 @@ AttachmentsDirective = ($repo, $rs, $confirm) ->
$scope.uploadingFiles.splice(index, 1) $scope.uploadingFiles.splice(index, 1)
$confirm.notify("error", null, "We have not been able to upload '#{file.name}'.") #TODO: i18in $confirm.notify("error", null, "We have not been able to upload '#{file.name}'.") #TODO: i18in
###########
## On destroy ## On destroy
###########
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()
@ -237,9 +227,7 @@ AttachmentDirective = ($log, $repo, $confirm) ->
$el.removeClass("deprecated") $el.removeClass("deprecated")
$el.removeClass("hidden") $el.removeClass("hidden")
###########
## Initialize ## Initialize
###########
if not $attrs.tgAttachment? if not $attrs.tgAttachment?
return $log.error "AttachmentDirective the directive need an attachment" return $log.error "AttachmentDirective the directive need an attachment"
@ -247,9 +235,7 @@ AttachmentDirective = ($log, $repo, $confirm) ->
render(attachment, attachment.isCreatedRightNow) render(attachment, attachment.isCreatedRightNow)
delete attachment.isCreatedRightNow delete attachment.isCreatedRightNow
###########
## Actions (on view mode) ## Actions (on view mode)
###########
$el.on "click", "a.settings.icon-edit", (event) -> $el.on "click", "a.settings.icon-edit", (event) ->
event.preventDefault() event.preventDefault()
render(attachment, true) render(attachment, true)
@ -269,9 +255,7 @@ AttachmentDirective = ($log, $repo, $confirm) ->
$confirm.ask(title, subtitle).then -> $confirm.ask(title, subtitle).then ->
$repo.remove(attachment).then(onSuccess, onError) $repo.remove(attachment).then(onSuccess, onError)
###########
## Actions (on edit mode) ## Actions (on edit mode)
###########
$el.on "click", "a.editable-settings.icon-floppy", (event) -> $el.on "click", "a.editable-settings.icon-floppy", (event) ->
event.preventDefault() event.preventDefault()
@ -296,9 +280,7 @@ AttachmentDirective = ($log, $repo, $confirm) ->
event.preventDefault() event.preventDefault()
render(attachment) render(attachment)
###########
## On destroy ## On destroy
###########
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()