chg: [eventGraph] fixed img_preview size, catch keyboard inputs and

removed useless function
pull/3449/head
Sami Mokaddem 2018-07-06 09:10:17 +00:00
parent 43275f3a90
commit 46ecaff0f2
2 changed files with 5 additions and 42 deletions

View File

@ -166,44 +166,4 @@ class EventNetworkHistoryController extends AppController {
}
}
public function fetchForm($action, $event_id, $id = null) {
$formURL = 'eventNetworkHistory_add_form';
if ($action == 'edit') {
$params = array(
'conditions' => array('EventNetworkHistory.id' => $id),
'flatten' => 1,
);
$networkHistory = $this->NetworkHistory->get($this->Auth->user(), $params);
if (empty($networkHistory)) throw new NotFoundException(__('Invalid network history'));
$networkHistory = $networkHistory[0];
$this->set('networkHistory', $networkHistory);
$formURL = 'eventNetworkHistory_add_form';
} else if ($action == 'delete') {
$params = array(
'conditions' => array('EventNetworkHistory.id' => $id),
'flatten' => 1,
);
//$networkHistory = $this->NetworkHistory->fetchNetworkHistory($this->Auth->user(), $params);
$networkHistory = $this->NetworkHistory->get($this->Auth->user(), $params);
if (empty($networkHistory)) throw new NotFoundException(__('Invalid network history'));
$networkHistory = $networkHistory[0];
$this->set('networkHistory', $networkHistory);
$formURL = 'eventNetworkHistory_delete_form';
}
if (!$this->_isSiteAdmin()) {
if ($networkHistory['org_id'] == $this->Auth->user('org_id')
&& (($this->userRole['perm_modify'] && $networkHistory['user_id'] != $this->Auth->user('id'))
|| $this->userRole['perm_modify_org'])) {
// Allow the edit
} else {
throw new NotFoundException(__('Invalid network history'));
}
}
$this->set('action', $action);
$this->set('event_id', $event_id);
$this->render('ajax/' . $formURL);
}
}

View File

@ -609,7 +609,7 @@ class EventGraph {
btn_plot.data('network-preview', preview);
btn_plot.popover({
container: 'body',
content: function() { return '<img src="' + $(this).data('network-preview') + '" />'; },
content: function() { return '<img style="width: 500px; height: 150px;" src="' + $(this).data('network-preview') + '" />'; },
placement: 'right',
trigger: 'hover',
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content" style="width: 500px; height: 150px;"></div></div>',
@ -1876,7 +1876,7 @@ function reset_graph_history() {
btn_plot.data('network-preview', preview);
btn_plot.popover({
container: 'body',
content: function() { return '<img src="' + $(this).data('network-preview') + '" />'; },
content: function() { return '<img style="width: 500px; height: 150px;" src="' + $(this).data('network-preview') + '" />'; },
placement: 'right',
trigger: 'hover',
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content" style="width: 500px; height: 150px;"></div></div>',
@ -2067,6 +2067,9 @@ function enable_interactive_graph() {
}
return;
}
if (evt.target !== undefined && $(evt.target).is('input')) {
return;
}
switch(evt.keyCode) {
case 88: // x
var selected_id = eventGraph.network.getSelectedNodes()[0];