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.4.27 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.4 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.26 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.3 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.25 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.2 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.24 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.1 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.23 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.22 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.0 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.21 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.0.beta.1 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.20 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.19 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.18 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.17 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.16 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.15 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.14 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js