go to doc on list row click

remotes/origin/yandex
Bachurin Sergey 12 years ago
parent fefb2e88b7
commit 06a500116c
  1. 2
      project/static/css/style.css
  2. 14
      project/static/js/docs/list.panels.js

@ -219,3 +219,5 @@ div.blockMsg { width: 100%; height: 100%; top: 0; left: 0; text-align: center; }
.doc_status1, .doc_statusFalse, .doc_statusfalse {color:red;}
.doc_status3, .doc_statusTrue, .doc_statustrue {color:green;}
.doc_status2 {color:blue;}
tr.doc-row:hover {cursor:pointer;}

@ -55,6 +55,12 @@ $(document).ready(function() {
return $('#'+panel_id);
}
doc_rows.click(function(e){
e.preventDefault();
var link = $($(this).find('a')[0]).attr('href');
console.log(link);
location.replace(link);
})
$('.toggle_doc_status').on('click', function(e){
e.preventDefault();
$this = $(this);
@ -63,13 +69,7 @@ $(document).ready(function() {
var doc_attr = $this.data("attr")
$.post('/my/docs/ajax_toggle_doc_status/' + doc_type + '/' + doc_id + '/' + doc_attr + '/', function(data){
$this.text(data[0]);
$this.removeClass('doc_status1');
$this.removeClass('doc_status2');
$this.removeClass('doc_status3');
$this.removeClass('doc_statustrue');
$this.removeClass('doc_statusTrue');
$this.removeClass('doc_statusFalse');
$this.removeClass('doc_statusfalse');
$this.removeClass('doc_status1 doc_status2 doc_status3 doc_statustrue doc_statusTrue doc_statusFalse doc_statusfalse');
$this.addClass('doc_status' + data[1]);
})

Loading…
Cancel
Save