Sha256: c4d0dfa6f7050ca887972820255e9964a623fe7f7fdbfb5cf2f56039008f817e
Contents?: true
Size: 1.08 KB
Versions: 7
Compression:
Stored size: 1.08 KB
Contents
/*global cull, dome*/ this.gts = this.gts || {}; /** * When clicking clone URLs, copy them to the related input field. */ this.gts.cloneUrlSelection = (function () { function selectCloneUrl(element, selected) { var links = dome.byClass("gts-repo-url", element); cull.doall(cull.partial(dome.cn.rm, "active"), links); if (selected) { dome.cn.add("active", selected); var input = dome.byClass("gts-current-repo-url", element)[0]; input.value = selected.getAttribute("href").replace("ssh://", ""); input.focus(); } } function cloneUrlSelection(element) { var input = element.getElementsByTagName("input")[0]; if (input) { dome.on(input, "focus", function (e) { this.select(); }); } dome.delegate.bycn("gts-repo-url", element, "click", function (e) { e.preventDefault(); e.stopPropagation(); selectCloneUrl(element, e.target); }); } cloneUrlSelection.select = selectCloneUrl; return cloneUrlSelection; }());
Version data entries
7 entries across 7 versions & 1 rubygems