From 1bdf75e295aead74b33cec621b0ed13716c6afb7 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Mon, 10 Mar 2014 00:12:49 -0300 Subject: [PATCH] rows clickeables --- .../src/main/webapp/css/mindmapList.less | 9 ++++++++ wise-webapp/src/main/webapp/js/mindmapList.js | 21 ++++++++++++++++--- .../src/main/webapp/jsp/mindmapList.jsp | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/wise-webapp/src/main/webapp/css/mindmapList.less b/wise-webapp/src/main/webapp/css/mindmapList.less index e18b719a..4b948472 100644 --- a/wise-webapp/src/main/webapp/css/mindmapList.less +++ b/wise-webapp/src/main/webapp/css/mindmapList.less @@ -47,6 +47,10 @@ -moz-border-radius: @radius; } +.mindmapName { + color: #428bca; +} + /* ------------------------------ Table --------------------------------- */ @table-gap: 2%; @@ -106,6 +110,10 @@ input#selectAll { padding: 4px; } +#mindmapListTable tbody tr { + cursor: pointer; +} + /* Pagination Styles */ #paginateContainer { height: 40px; @@ -194,6 +202,7 @@ input#selectAll { .closeTag { cursor: pointer; + z-index: 2000; } .tableTag { diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index de5c580a..4404e1d7 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -254,8 +254,23 @@ function updateStarred(spanElem) { function callbackOnTableInit() { // Register starred events ... - $('#mindmapListTable .starredOff, #mindmapListTable .starredOn').click(function () { + $('#mindmapListTable .starredOff, #mindmapListTable .starredOn').click(function (event) { updateStarred(this); + event.stopPropagation(); + }); + + $("#mindmapListTable tbody tr").click( + function(event) { + var target = $(event.target); + if (!target.is('.closeTag')){ + if (!target.parent().is('.closeTag')) { + var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/")); + window.open(baseUrl + 'c/maps/' + $(this).find('.mindmapName').attr('value') + '/edit' , '_self'); + } + } + }); + $('input:checkbox').click(function(event) { + event.stopPropagation(); }); updateStatusToolbar(); } @@ -474,9 +489,9 @@ $(function () { }) }); - $(document).on('click', ".closeTag", function() { + $(document).on('click', ".closeTag", function(event) { var me = $(this); - var mindmapId = me.parents("td").find("a").attr("value"); + var mindmapId = me.parents("td").find(".mindmapName").attr("value"); var data = { id: me.attr("value"), title: me.attr("name"), diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 99d74059..827dc4d1 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -58,7 +58,7 @@ bUseRendered: false, mDataProp: "title", fnRender: function (obj) { - return '' + $('').text(obj.aData.title).html() + '' + labelTagsAsHtml(obj.aData.labels); + return '' + $('').text(obj.aData.title).html() + '' + labelTagsAsHtml(obj.aData.labels); } }, {