From 06a500116c4b010b6a123da3c7ffb117f1ae1864 Mon Sep 17 00:00:00 2001 From: Bachurin Sergey Date: Fri, 25 Jul 2014 15:34:34 +0300 Subject: [PATCH] go to doc on list row click --- project/static/css/style.css | 2 ++ project/static/js/docs/list.panels.js | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/project/static/css/style.css b/project/static/css/style.css index b0e951d..23a9457 100644 --- a/project/static/css/style.css +++ b/project/static/css/style.css @@ -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;} diff --git a/project/static/js/docs/list.panels.js b/project/static/js/docs/list.panels.js index 2be3eb8..85bff23 100644 --- a/project/static/js/docs/list.panels.js +++ b/project/static/js/docs/list.panels.js @@ -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]); })