Sha256: a68e0aa082c87ffb73f8e3411bb5ca672162231a3ccd640663de1ffa4a3b51df

Contents?: true

Size: 813 Bytes

Versions: 62

Compression:

Stored size: 813 Bytes

Contents

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

    var removeSummary = function (event, confirmed) {
            var $target = $(event.delegateTarget),
                selector = $target.data('domRemove');

            if (_.isEmpty($target.filter('[data-confirm]')) || confirmed) {
                $target.closest(selector).fadeOut(function() { $(this).remove(); });
            } else {
                $target.one('confirm:complete', removeSummary);
            }
        },

        /**
         * @method
         * @name init
         * @memberof WORKAREA.domRemove
         */
        init = function ($scope) {
            $('[data-dom-remove]', $scope).on('click', removeSummary);
        };

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