Sha256: 53e0cea40b98194f214ddad769f392dafe6032511dc515fd803d73b3c2d625ff

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

/**
 * @namespace WORKAREA.optionalFeature
 */

 WORKAREA.registerModule('optionalFeature', (function () {
  'use strict';

    var onCheckboxClick = function (event) {
        var target = $("[data-grayscale-target]")
        target.toggleClass('img-filter-grayscale')
    },

    flipImage = function (event) {
        var target = $("[data-flipimage-target]")
        target.toggleClass('img-transform-mirror')
    },

    personalize = function (event) {
        $('#add-text').toggle();
    },
    

    init = function ($scope) {
        $('input[type="checkbox"][data-grayscale]', $scope).on('click', onCheckboxClick); 
        $('input[type="checkbox"][data-flipimage]', $scope).on('click', flipImage); 
        $('#text', $scope).on('click', personalize);
    };

    return {
        init: init
    };

}()));

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-image_decoration-1.0.0.pre app/assets/javascripts/workarea/storefront/image_decoration/modules/optional_feature.js