increase clickable area around editable columns' checkboxes
This commit is contained in:
@@ -301,6 +301,16 @@ form.realtime table tr td.checkbox-cell div.checkbox-contain {
|
|||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
form.realtime table tr td.checkbox-cell div.checkbox-contain label {
|
||||||
|
background-color: transparent;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
form.realtime table tr td.checkbox-cell div.checkbox-contain input[type="checkbox"]:not(.editable) {
|
form.realtime table tr td.checkbox-cell div.checkbox-contain input[type="checkbox"]:not(.editable) {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -370,6 +370,17 @@ form.realtime {
|
|||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
label {
|
||||||
|
background-color: transparent;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
&[type="checkbox"] {
|
&[type="checkbox"] {
|
||||||
|
|||||||
@@ -81,10 +81,13 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
var $cover = $('<span>', {
|
var $cover = $('<span>', {
|
||||||
'for': id,
|
|
||||||
'class': 'cover'
|
'class': 'cover'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var $label = $('<label>', {
|
||||||
|
'for': id,
|
||||||
|
}); //.text("WAT");
|
||||||
|
|
||||||
var $check = Input({
|
var $check = Input({
|
||||||
id: id,
|
id: id,
|
||||||
name: id,
|
name: id,
|
||||||
@@ -104,7 +107,10 @@ define([
|
|||||||
$check.addClass('editable');
|
$check.addClass('editable');
|
||||||
}
|
}
|
||||||
|
|
||||||
$div.append($check);
|
$div
|
||||||
|
//.append($label)
|
||||||
|
.append($check)
|
||||||
|
.append($label);
|
||||||
$check.after($cover);
|
$check.after($cover);
|
||||||
|
|
||||||
return $div; //$check;
|
return $div; //$check;
|
||||||
@@ -189,7 +195,8 @@ define([
|
|||||||
$edit[bool?'addClass':'removeClass']('editable');
|
$edit[bool?'addClass':'removeClass']('editable');
|
||||||
|
|
||||||
var $sel = $('input[id^="' + id + '"]')
|
var $sel = $('input[id^="' + id + '"]')
|
||||||
[bool?'addClass':'removeClass']('editable');
|
[bool?'addClass':'removeClass']('editable')
|
||||||
|
.attr('disabled', !bool);
|
||||||
|
|
||||||
if (bool) {
|
if (bool) {
|
||||||
module.rt.proxy.table.colsOrder.forEach(function (coluid) {
|
module.rt.proxy.table.colsOrder.forEach(function (coluid) {
|
||||||
@@ -408,7 +415,7 @@ define([
|
|||||||
}
|
}
|
||||||
var checked = box.checked = proxy.table.cells[uid] ? true : false;
|
var checked = box.checked = proxy.table.cells[uid] ? true : false;
|
||||||
if (checked) {
|
if (checked) {
|
||||||
$(box).parent().find('.cover').addClass('yes');
|
$(box).closest('.checkbox-contain').find('.cover').addClass('yes');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -500,13 +507,12 @@ define([
|
|||||||
console.log("[Table.cell change] %s (%s => %s)@[%s]", id, o, n, p.slice(0, -1).join(', '));
|
console.log("[Table.cell change] %s (%s => %s)@[%s]", id, o, n, p.slice(0, -1).join(', '));
|
||||||
var checked = el.checked = proxy.table.cells[id] ? true: false;
|
var checked = el.checked = proxy.table.cells[id] ? true: false;
|
||||||
|
|
||||||
var $parent = $(el).parent();
|
var $parent = $(el).closest('.checkbox-contain');
|
||||||
|
|
||||||
if (!$parent.length) { console.log("couldn't find parent element of checkbox"); return; }
|
if (!$parent.length) { console.log("couldn't find parent element of checkbox"); return; }
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
$parent.find('.cover').addClass('yes');
|
$parent.find('.cover').addClass('yes');
|
||||||
//$(el).parent().
|
|
||||||
} else {
|
} else {
|
||||||
$parent.find('.cover').removeClass('yes');
|
$parent.find('.cover').removeClass('yes');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user