Merge pull request #8044 from apricot12/Undo_reversing_of_email_copy_paste

Allow copy paste of email from contact tab and footer without reversing
This commit is contained in:
Andy Brett
2021-08-26 10:02:09 -07:00
committed by GitHub
4 changed files with 10 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
angular.module('Darkswarm').directive "obfuscatedEmail", ()->
restrict: 'C'
link: (scope, element, attrs)->
element.on 'cut copy', (event)->
event.preventDefault()
clipboardData = event.clipboardData || window.clipboardData || event.originalEvent.clipboardData
clipboardData.setData('text/plain', document.getSelection().toString().split('').reverse().join(''))

View File

@@ -5,7 +5,7 @@
%p{"ng-if" => "::enterprise.email_address"}
%a{"ng-href" => "{{::enterprise.email_address | stripUrl}}", target: "_blank", mailto: true}
%span.email{"ng-bind" => "::enterprise.email_address | stripUrl"}
%span.obfuscatedEmail.email{"ng-bind" => "::enterprise.email_address | stripUrl"}
%p{"ng-if" => "enterprise.website"}
%a{"ng-href" => "http://{{::enterprise.website | stripUrl}}", target: "_blank", "ng-bind" => "::enterprise.website | stripUrl"}

View File

@@ -40,7 +40,7 @@
%p.word-wrap{"ng-if" => "::producer.email_address"}
%a{"ng-href" => "{{::producer.email_address | stripUrl}}", target: "_blank", mailto: true}
%span.email{"ng-bind" => "::producer.email_address | stripUrl"}
%span.obfuscatedEmail.email{"ng-bind" => "::producer.email_address | stripUrl"}
%p.word-wrap{"ng-if" => "::producer.website"}
%a{"ng-href" => "http://{{::producer.website | stripUrl}}", target: "_blank" }

View File

@@ -32,7 +32,7 @@
%br
- if current_distributor.email_address.present?
%a{href: current_distributor.email_address.reverse, mailto: true}
%span.email
%span.obfuscatedEmail.email
= current_distributor.email_address.reverse
.small-12.large-4.columns