diff --git a/app/coffee/modules/common/attachments.coffee b/app/coffee/modules/common/attachments.coffee index b1c474e7..edef5486 100644 --- a/app/coffee/modules/common/attachments.coffee +++ b/app/coffee/modules/common/attachments.coffee @@ -95,11 +95,6 @@ AttachmentsDirective = ($repo, $rs, $confirm) -> .prop("title", "show deprecated attachments") # TODO: i18n $el.find("div.single-attachment.deprecated").addClass("hidden") - ## Add Attachments - $el.on "click", "a.add-attach", -> - event.preventDefault() - angular.element("input.add-attach").trigger("click") - $el.on "change", "input.add-attach", -> files = _.map(event.target.files, (x) -> x) return if files.length < 1 diff --git a/app/partials/views/modules/attachments.jade b/app/partials/views/modules/attachments.jade index 61d20e32..0e01c766 100644 --- a/app/partials/views/modules/attachments.jade +++ b/app/partials/views/modules/attachments.jade @@ -7,9 +7,9 @@ section.attachments(tg-attachments, ng-model=attachModel, ng-if="#{attachModel}. span.icon.icon-attachments span.attachments-num 0 span.attachments-text attachments - a.button.button-gray.add-attach(tg-check-permission, permission="modify_"+permissionSuffix, href="", title="Add new attachment") + div.button.button-gray.add-attach(tg-check-permission, permission="modify_"+permissionSuffix, title="Add new attachment") span +new file - input.hidden.add-attach(type="file", multiple="multiple") + input.add-attach(type="file", multiple="multiple") div.attachment-body.sortable div.hidden.single-attachment(ng-repeat="attach in attachments", diff --git a/app/styles/modules/common/attachments.scss b/app/styles/modules/common/attachments.scss index 84edcd04..eb2d88aa 100644 --- a/app/styles/modules/common/attachments.scss +++ b/app/styles/modules/common/attachments.scss @@ -157,3 +157,17 @@ background: lighten($green-taiga, 60%); } } + +.add-attach { + position: relative; + input { + cursor: pointer; + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + z-index: 9999; + opacity: 0; + } +} \ No newline at end of file