fix: [UI] Show context button

pull/8250/head
Jakub Onderka 2022-03-30 10:34:22 +02:00
parent 4065642667
commit 464504fa16
4 changed files with 10 additions and 15 deletions

View File

@ -66,7 +66,6 @@
</div>
</div>
<script type="text/javascript">
var showContext = false;
$(function () {
<?php
if (!Configure::check('MISP.disable_event_locks') || !Configure::read('MISP.disable_event_locks')) {
@ -77,8 +76,6 @@ $(function () {
);
}
?>
popoverStartup();
$(document.body).tooltip({
selector: 'span[title], td[title], time[title]',
placement: 'top',

View File

@ -126,7 +126,7 @@
);
}
if (!empty($buttonData)) {
$tagData .= implode('', $buttonData);
$tagData .= '<span style="white-space:nowrap">' . implode('', $buttonData) . '</span>';
}
echo sprintf(
'<span class="tag-list-container">%s</span>',

View File

@ -11,7 +11,3 @@ echo $this->element('galaxyQuickViewNew', [
'target_id' => $scope == 'event' ? $object['Event']['id'] : $object['Attribute']['id'],
'target_type' => $scope
]);
?>
<script type="text/javascript">
var showContext = false;
</script>

View File

@ -4102,23 +4102,25 @@ function feedFormUpdate() {
}
function setContextFields() {
if (typeof showContext === "undefined") {
showContext = false;
}
var $button = $('#show_attribute_context');
if (showContext) {
$('.context').show();
$('#show_context').addClass("attribute_filter_text_active");
$('#show_context').removeClass("attribute_filter_text");
$button.removeClass("btn-inverse").addClass("btn-primary");
} else {
$('.context').hide();
$('#show_context').addClass("attribute_filter_text");
$('#show_context').removeClass("attribute_filter_text_active");
$button.removeClass("btn-primary").addClass("btn-inverse");
}
}
function toggleContextFields() {
if (!showContext) {
showContext = true;
} else {
if (typeof showContext === "undefined") {
showContext = false;
}
showContext = !showContext;
setContextFields();
}