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.15 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.36 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.14 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.35 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.13 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.34 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.12 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.33 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.11 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.10 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.32 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.9 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.31 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.8 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.30 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.7 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.29 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.6 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.4.28 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js
workarea-admin-3.5.5 app/assets/javascripts/workarea/admin/modules/add_to_calendar_buttons.js