mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
move onselect() method into timeline view, because it's only needed there
This commit is contained in:
parent
dd8f9c7186
commit
1e26bc181b
|
@ -3676,7 +3676,7 @@ $(document).ready(function() {
|
|||
*
|
||||
* @param object $document document
|
||||
*/
|
||||
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array()) { /* {{{ */
|
||||
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array(), $onselect="") { /* {{{ */
|
||||
if(!$timelineurl)
|
||||
return;
|
||||
?>
|
||||
|
@ -3703,21 +3703,16 @@ $(document).ready(function() {
|
|||
'locale': '<?php echo $this->params['session']->getLanguage() ?>'
|
||||
};
|
||||
|
||||
function onselect() {
|
||||
var sel = timeline.getSelection();
|
||||
if (sel.length) {
|
||||
if (sel[0].row != undefined) {
|
||||
var row = sel[0].row;
|
||||
console.log(timeline.getItem(sel[0].row));
|
||||
item = timeline.getItem(sel[0].row);
|
||||
$('div.ajax').trigger('update', {documentid: item.docid, version: item.version, statusid: item.statusid, statuslogid: item.statuslogid, fileid: item.fileid});
|
||||
}
|
||||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
// Instantiate our timeline object.
|
||||
timeline = new links.Timeline(document.getElementById('timeline'), options);
|
||||
links.events.addListener(timeline, 'select', onselect);
|
||||
<?php
|
||||
if($onselect):
|
||||
?>
|
||||
links.events.addListener(timeline, 'select', <?= $onselect ?>);
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
$.getJSON(
|
||||
'<?php echo $timelineurl ?>',
|
||||
function(data) {
|
||||
|
|
|
@ -155,10 +155,21 @@ $(document).ready(function () {
|
|||
);
|
||||
});
|
||||
});
|
||||
function onselect() {
|
||||
var sel = timeline.getSelection();
|
||||
if (sel.length) {
|
||||
if (sel[0].row != undefined) {
|
||||
var row = sel[0].row;
|
||||
console.log(timeline.getItem(sel[0].row));
|
||||
item = timeline.getItem(sel[0].row);
|
||||
$('div.ajax').trigger('update', {documentid: item.docid, version: item.version, statusid: item.statusid, statuslogid: item.statuslogid, fileid: item.fileid});
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
$this->printDeleteDocumentButtonJs();
|
||||
$timelineurl = 'out.Timeline.php?action=data&fromdate='.date('Y-m-d', $from).'&todate='.date('Y-m-d', $to).'&skip='.urldecode(http_build_query(array('skip'=>$skip)));
|
||||
$this->printTimelineJs($timelineurl, 550, ''/*date('Y-m-d', $from)*/, ''/*date('Y-m-d', $to+1)*/, $skip);
|
||||
$this->printTimelineJs($timelineurl, 550, ''/*date('Y-m-d', $from)*/, ''/*date('Y-m-d', $to+1)*/, $skip, 'onselect');
|
||||
$this->printClickDocumentJs();
|
||||
} /* }}} */
|
||||
|
||||
|
|
|
@ -3752,7 +3752,7 @@ $(document).ready(function() {
|
|||
*
|
||||
* @param object $document document
|
||||
*/
|
||||
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array()) { /* {{{ */
|
||||
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array(), $onselect="") { /* {{{ */
|
||||
if(!$timelineurl)
|
||||
return;
|
||||
?>
|
||||
|
@ -3779,21 +3779,16 @@ $(document).ready(function() {
|
|||
'locale': '<?php echo $this->params['session']->getLanguage() ?>'
|
||||
};
|
||||
|
||||
function onselect() {
|
||||
var sel = timeline.getSelection();
|
||||
if (sel.length) {
|
||||
if (sel[0].row != undefined) {
|
||||
var row = sel[0].row;
|
||||
console.log(timeline.getItem(sel[0].row));
|
||||
item = timeline.getItem(sel[0].row);
|
||||
$('div.ajax').trigger('update', {documentid: item.docid, version: item.version, statusid: item.statusid, statuslogid: item.statuslogid, fileid: item.fileid});
|
||||
}
|
||||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
// Instantiate our timeline object.
|
||||
timeline = new links.Timeline(document.getElementById('timeline'), options);
|
||||
links.events.addListener(timeline, 'select', onselect);
|
||||
<?php
|
||||
if($onselect):
|
||||
?>
|
||||
links.events.addListener(timeline, 'select', <?= $onselect ?>);
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
$.getJSON(
|
||||
'<?php echo $timelineurl ?>',
|
||||
function(data) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user