Sha256: 21d2a44f9c9db8060b5c8755ccea987a75bf5b55b4798e90127a286dc09792c5

Contents?: true

Size: 786 Bytes

Versions: 6

Compression:

Stored size: 786 Bytes

Contents

/*global cull, dome*/
this.gts = this.gts || {};

/**
 * When clicking clone URLs, copy them to the related input field.
 */
this.gts.cloneUrlSelection = 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();
        var links = dome.byClass("gts-repo-url", element);
        cull.doall(cull.partial(dome.cn.rm, "active"), links);
        if (e.target) {
            dome.cn.add("active", e.target);
            var input = dome.byClass("gts-current-repo-url")[0];
            input.value = e.target.href;
            input.focus();
        }
    });
};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dolt-0.23.0 vendor/ui/js/src/components/clone-url-selection.js
dolt-0.22.0 vendor/ui/js/src/components/clone-url-selection.js
dolt-0.21.0 vendor/ui/js/src/components/clone-url-selection.js
dolt-0.20.0 vendor/ui/js/src/components/clone-url-selection.js
dolt-0.19.0 vendor/ui/js/src/components/clone-url-selection.js
dolt-0.18.0 vendor/ui/js/src/components/clone-url-selection.js