mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
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:
@@ -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(''))
|
||||
@@ -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"}
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user