Sha256: 25230efd395d32ea18008a4ac44773c5d9a43ad287c37a02ea9fd55ed5d8317a

Contents?: true

Size: 806 Bytes

Versions: 62

Compression:

Stored size: 806 Bytes

Contents

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

    var disableEditMode = function(event) {
            var $cancelButton = $(event.currentTarget),
                $editor = $cancelButton.closest('.content-editor'),
                $activeBlock = $('.content-block--active', $editor);

            event.preventDefault();
            WORKAREA.contentBlocks.deactivateBlock($activeBlock);
        },

        /**
         * @method
         * @name init
         * @memberof WORKAREA.contentEditorFormCancel
         */
        init = function ($scope) {
            $('[data-content-editor-form-cancel]', $scope)
            .on('click', disableEditMode);
        };

    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/content_editor_form_cancel.js
workarea-admin-3.4.12 app/assets/javascripts/workarea/admin/modules/content_editor_form_cancel.js