Commit fa305524 authored by Mingsong Hu's avatar Mingsong Hu

Remove the tooltip feature. Use Drupal Pop-up dialog instead.

parent a0311110
......@@ -49,15 +49,6 @@ libraries.fullcalendar:
- fullcalendar_view/libraries.fullcalendar-theme
- fullcalendar_view/libraries.rrule
tooltip:
version: 1.0
css:
theme:
css/jquery.qtip.min.css: { minified: true }
js:
js/jquery.qtip.min.js: { minified: true }
js/tooltip-plugin.js: {}
# Feature libraries.
fullcalendar:
js:
......
This diff is collapsed.
This diff is collapsed.
/**
* @file
* Fullcalendar Tooltip plugin JavaScript file.
*
* Custom tooltip plugin for FullCalendar.
* More options see:
* http://qtip2.com/options.
*/
(function ($) {
$.fn.fullCalendarTooltip = function (title, description) {
if (typeof this.qtip === 'function') {
this.qtip({
content: {
text: description,
title: title,
},
position: {
my: 'bottom center', // Position my bottom center...
at: 'top center', // At the top center of...
},
style: {
classes: 'qtip-bootstrap qtip-shadow'
}
});
}
return this;
};
}
)(jQuery);
......@@ -70,8 +70,6 @@ class FullcalendarViewPreprocess {
}
// Field machine name of end date.
$end_field = $options['end'];
// Field machine name for event description.
$des_field = $options['des'];
// Field machine name of taxonomy field.
$tax_field = $options['tax_field'];
// Field machine name of event duration.
......@@ -148,38 +146,6 @@ class FullcalendarViewPreprocess {
$start_date = $current_entity->get($start_field)->getValue();
// Calendar event end date.
$end_date = empty($end_field) || !$current_entity->hasField($end_field) ? '' : $current_entity->get($end_field)->getValue();
// Description for events. For multiple bundle types,
// there might be more than one field specified.
if (!empty($des_field) && is_array($des_field)) {
// Render all other fields to so they can be used in rewrite.
foreach ($fields as $field) {
if (method_exists($field, 'advancedRender')) {
$field->advancedRender($row);
}
}
// We need to render the description field again,
// in case a replacement pattern for other field.
// For exmaple, {{field name}}.
foreach ($des_field as $des_field_name) {
if (isset($fields[$des_field_name])
&& method_exists($fields[$des_field_name], 'advancedRender')) {
$des_raw = $fields[$des_field_name]->advancedRender($row);
$des = empty($des_raw) ? '' : $des_raw;
// We just need only one description text.
// Once we got it, quit the loop.
break;
}
}
}
if (!isset($des)) {
$des = '';
}
if (is_array($des)) {
$des = reset($des);
if (isset($des['value'])) {
$des = $des['value'];
}
}
// Event title.
if (empty($options['title']) || $options['title'] == 'title') {
$title = $fields['title']->advancedRender($row);
......@@ -192,7 +158,6 @@ class FullcalendarViewPreprocess {
}
$entry = [
'title' => Xss::filterAdmin($title),
'description' => Xss::filterAdmin($des),
'id' => $entity_id,
'url' => $current_entity->toUrl()->toString(),
];
......@@ -320,10 +285,7 @@ class FullcalendarViewPreprocess {
// Remove the row_index property as we don't it anymore.
unset($view->row_index);
// Load tooltip plugin.
if (!empty($des_field)) {
$variables['#attached']['library'][] = 'fullcalendar_view/tooltip';
}
// Fullcalendar options.
$calendar_options = [
'plugins' => [ 'moment','interaction', 'dayGrid', 'timeGrid', 'list', 'rrule' ],
'defaultView' => isset($options['default_view']) ? $options['default_view'] : 'dayGridMonth',
......
......@@ -70,7 +70,6 @@ class FullCalendarDisplay extends StylePluginBase {
$options['defaultDate'] = ['default' => ''];
$options['start'] = ['default' => ''];
$options['end'] = ['default' => ''];
$options['des'] = ['default' => ''];
$options['title'] = ['default' => ''];
$options['duration'] = ['default' => ''];
$options['rrule'] = ['default' => ''];
......@@ -156,6 +155,7 @@ class FullCalendarDisplay extends StylePluginBase {
'#description' => $this->t('The field value should be a string in the format hh:mm:ss.sss, hh:mm:sss or hh:mm. For example, "05:00" signifies 5 hours.'),
'#type' => 'select',
'#options' => $field_names,
'#empty_value' => '',
'#default_value' => (!empty($this->options['duration'])) ? $this->options['duration'] : '',
];
// Field name of title.
......@@ -165,16 +165,6 @@ class FullCalendarDisplay extends StylePluginBase {
'#options' => $field_names,
'#default_value' => (!empty($this->options['title'])) ? $this->options['title'] : '',
];
// Field for description.
$form['des'] = [
'#title' => $this->t('Description Field'),
'#description' => $this->t('Description for event tooltip. If select none, there will not be popup tooltip. For multiple content types, you can select multiple fields here.'),
'#type' => 'select',
'#options' => $field_names,
'#empty_value' => '',
'#default_value' => (!empty($this->options['des'])) ? $this->options['des'] : '',
'#multiple' => TRUE,
];
// Display settings.
$form['display'] = [
'#type' => 'details',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment