rows clickeables

This commit is contained in:
Ezequiel Bergamaschi 2014-03-10 00:12:49 -03:00
parent 2b5c1518f4
commit 16985ae7d7
3 changed files with 28 additions and 4 deletions

View File

@ -47,6 +47,10 @@
-moz-border-radius: @radius; -moz-border-radius: @radius;
} }
.mindmapName {
color: #428bca;
}
/* ------------------------------ Table --------------------------------- */ /* ------------------------------ Table --------------------------------- */
@table-gap: 2%; @table-gap: 2%;
@ -106,6 +110,10 @@ input#selectAll {
padding: 4px; padding: 4px;
} }
#mindmapListTable tbody tr {
cursor: pointer;
}
/* Pagination Styles */ /* Pagination Styles */
#paginateContainer { #paginateContainer {
height: 40px; height: 40px;
@ -194,6 +202,7 @@ input#selectAll {
.closeTag { .closeTag {
cursor: pointer; cursor: pointer;
z-index: 2000;
} }
.tableTag { .tableTag {

View File

@ -254,8 +254,23 @@ function updateStarred(spanElem) {
function callbackOnTableInit() { function callbackOnTableInit() {
// Register starred events ... // Register starred events ...
$('#mindmapListTable .starredOff, #mindmapListTable .starredOn').click(function () { $('#mindmapListTable .starredOff, #mindmapListTable .starredOn').click(function (event) {
updateStarred(this); 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(); updateStatusToolbar();
} }
@ -474,9 +489,9 @@ $(function () {
}) })
}); });
$(document).on('click', ".closeTag", function() { $(document).on('click', ".closeTag", function(event) {
var me = $(this); var me = $(this);
var mindmapId = me.parents("td").find("a").attr("value"); var mindmapId = me.parents("td").find(".mindmapName").attr("value");
var data = { var data = {
id: me.attr("value"), id: me.attr("value"),
title: me.attr("name"), title: me.attr("name"),

View File

@ -58,7 +58,7 @@
bUseRendered: false, bUseRendered: false,
mDataProp: "title", mDataProp: "title",
fnRender: function (obj) { fnRender: function (obj) {
return '<a class="mindmapName" value="'+ obj.aData.id +'" href="c/maps/' + obj.aData.id + '/edit">' + $('<span></span>').text(obj.aData.title).html() + '</a>' + labelTagsAsHtml(obj.aData.labels); return '<span class="mindmapName" value="'+ obj.aData.id +'" href="c/maps/' + obj.aData.id + '/edit">' + $('<span></span>').text(obj.aData.title).html() + '</span>' + labelTagsAsHtml(obj.aData.labels);
} }
}, },
{ {