Sha256: d2d3d9c49a4d5147f3fd590590bc171722e32e15b7ab1ccdf023932b4f9622b7

Contents?: true

Size: 854 Bytes

Versions: 14

Compression:

Stored size: 854 Bytes

Contents

function buttonhandler() {

    $(".like-btn, .flag-confirm").click(function(e) {
        button = $(this);
        imageId = $(".fancybox-wrap, .image-show").attr("id");
        if (!$(button).is(".already-clicked")) {
            url = $(button).attr("href");
            $.post(url, function() {
                $(button).addClass("already-clicked");
                $("#" + imageId + " .text-overlay").find(".initial-state").addClass("already-clicked");
            });
        }

        if ($(button).is(".like-btn")) {
            $("#" + imageId + " .like-btn").toggle();
        } else if ($(button).is(".flag-confirm")) {
            $("#" + imageId + " .flag-btn.initial-state").remove();
            $("#" + imageId + " .flag-btn.secondary-state").show();
            $('.modal').modal('hide');
        }
        e.preventDefault();
    });
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
lentil-0.5.2 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.5.1 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.5.0 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.4.2 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.4.0 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.3.1 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.3.0 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.2.3 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.2.2 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.2.1 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.2.0 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.1.8 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.1.7 app/assets/javascripts/lentil/buttonhandler.js
lentil-0.1.6 app/assets/javascripts/lentil/buttonhandler.js