Sha256: b205931001e9cb55f2d6506c5c012dd919ddd7c6de095e1369ee37f86bf144d9
Contents?: true
Size: 790 Bytes
Versions: 4
Compression:
Stored size: 790 Bytes
Contents
/** * @namespace WORKAREA.copyText */ WORKAREA.registerModule('copyText', (function () { 'use strict'; var /** * @method * @name init * @memberof WORKAREA.copyText */ handleCopyText = function(e) { var elem = $(e.target), source = elem.attr('data-copy-text'), sourceElem = $(source)[0]; /* Select the text field */ sourceElem.select(); sourceElem.setSelectionRange(0, 99999); /*For mobile devices*/ document.execCommand("copy"); elem.fadeOut(); elem.fadeIn(); elem.html("Copied!"); }, init = function ($scope) { $('[data-copy-text]',$scope).on("click", handleCopyText); }; return { init: init }; }()));
Version data entries
4 entries across 4 versions & 1 rubygems