summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-input-mask.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-01-07 14:42:33 -0800
committerMark Wells <mark@freeside.biz>2014-01-07 14:42:33 -0800
commitb8ac178ea43778293a8b5b6cc261d24b121e09e7 (patch)
treebc3d0bd16f6495a1a14f6aa285fcad6fa6e7bc97 /httemplate/elements/tr-input-mask.html
parent429a48b18a54917b73b3add468d930f60bcdb2fe (diff)
improve MAC address clipboard copy hack, #25599
Diffstat (limited to 'httemplate/elements/tr-input-mask.html')
-rw-r--r--httemplate/elements/tr-input-mask.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/httemplate/elements/tr-input-mask.html b/httemplate/elements/tr-input-mask.html
index 922f22f4b..19942b58b 100644
--- a/httemplate/elements/tr-input-mask.html
+++ b/httemplate/elements/tr-input-mask.html
@@ -18,6 +18,10 @@ var t = document.getElementById('<% $id %>');
var container = document.getElementById('<%$id%>_clipboard');
var KeyHandlerDown = t.onkeydown
t.onkeydown = function(e) {
+ if (typeof(e) == 'undefined') {
+ // ie8 hack
+ e = event;
+ }
// intercept ctrl-c and ctrl-x
// and cmd-c and cmd-x on mac
// when text is selected
@@ -38,7 +42,7 @@ t.onkeydown = function(e) {
container.onkeyup = function(e) {
if ( container.previous ) {
setTimeout(function() {
- container.previous.value = container.value;
+ //container.previous.value = container.value;
container.previous.focus();
}, 10);
}
@@ -47,7 +51,7 @@ container.onkeyup = function(e) {
% } # clipboard hack
</&>
</script>
-<textarea id="<%$id%>_clipboard" style="opacity:0"></textarea>
+<input type="text" id="<%$id%>_clipboard" style="position:absolute; pointer-events: none; z-index: -1; opacity:0">
<%shared>
my $init = 0;
</%shared>