Sha256: 06a09b2dc4c2e7ec36ce3a367ae29fbf2bc40bed46e402197e0aff8578243a22

Contents?: true

Size: 1.25 KB

Versions: 62

Compression:

Stored size: 1.25 KB

Contents

/**
 * @namespace WORKAREA.publishCreateRelease
 */
WORKAREA.registerModule('publishCreateRelease', (function () {
    'use strict';

    var showReleaseUI = function($context) {
            $('.publish-create-release__fields', $context).removeClass('hidden');
            $('.publish-create-release__fields .text-box', $context).attr('required', 'required');
        },

        hideReleaseUI = function($context) {
            $('.publish-create-release__fields', $context).addClass('hidden');
            $('.publish-create-release__fields .text-box', $context).removeAttr('required');
        },

        handleChangeEvent = function(event) {
            var $input = $(event.currentTarget),
                $context = $input.closest('[data-publish-create-release]');

            if ($input.val() === 'new_release' ) {
                showReleaseUI($context);
            } else {
                hideReleaseUI($context);
            }
        },
        /**
         * @method
         * @name init
         * @memberof WORKAREA.publishCreateRelease
         */
        init = function ($scope) {
            $('[data-publish-create-release]', $scope)
            .on('change', 'input:radio', handleChangeEvent);
        };

    return {
        init: init
    };
}()));

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.4.13 app/assets/javascripts/workarea/admin/modules/publish_create_release.js
workarea-admin-3.4.12 app/assets/javascripts/workarea/admin/modules/publish_create_release.js