Sha256: ae49b783ed6ee86ad950a3ad03c4a107f2ddcd2576d8b32f1b25e543004b3a00

Contents?: true

Size: 1.28 KB

Versions: 62

Compression:

Stored size: 1.28 KB

Contents

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

    var toggleContent = function ($button, $moreInfo, event) {
            event.preventDefault();
            $button.tooltipster('content', $moreInfo);
        },

        initTooltip = function (button, $content) {
            var config = _.merge({}, WORKAREA.config.tooltipster, {
                    content: $content,
                    interactive: true
                });

            return $(button).tooltipster(config);
        },

        setup = function (index, button) {
            var data = $(button).data('addToCalendarButton'),
                $initial = $(data.initial),
                $moreInfo = $(data.moreInfo),
                $button = initTooltip(button, $initial),
                toggle = _.partial(toggleContent, $button, $moreInfo);

            $initial
                .find('[data-add-to-calendar-button-toggle]')
                .on('click', toggle);
        },

        /**
         * @method
         * @name init
         * @memberof WORKAREA.addToCalendarButtons
         */
        init = function ($scope) {
            $('[data-add-to-calendar-button]', $scope).each(setup);
        };

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

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.26 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.45 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.25 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.23 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.44 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.22 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.43 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.21 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.42 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.20 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.41 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.19 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.40 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.18 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.39 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.17 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.38 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.16 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.37 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js