'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _templates = require('../lib/templates');

const displayEvent = (event, cb) => {
  const content = (0, _templates.eventTemplate)({ event: event, uid: app.user.uid });
  const pid = event.pid;

  const div = $(content);
  const $display = $('#plugin-calendar-cal-event-display');
  $display.find('.modal-body').empty().append(div);
  $display.find('.modal-footer a.btn-primary').attr('href', `${ RELATIVE_PATH }/post/${ pid }`);
  $display.attr('data-pid', pid).modal('hide').modal('show');
  if (event.day) {
    $display.attr('data-day', event.day);
  }
  $(window).trigger('action:calendar.event.display', { pid: pid, day: event.day, modal: $display });

  if (typeof cb === 'function') {
    cb({ content: content, parsed: event });
  }
};

exports.default = displayEvent;
//# sourceMappingURL=displayEvent.js.map