move to dijit checkboxes in headlines/cdm list

This commit is contained in:
Andrew Dolgov 2012-12-25 14:13:52 +04:00
parent 363161024b
commit c4f5283052
5 changed files with 21 additions and 23 deletions

View file

@ -450,7 +450,8 @@ class Feeds extends Handler_Protected {
$reply['content'] .= "<div class='hlLeft'>";
$reply['content'] .= "<input type=\"checkbox\" onclick=\"tSR(this)\"
$reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
type=\"checkbox\" onclick=\"toggleSelectRow2(this)\"
id=\"RCHK-$id\">";
$reply['content'] .= "$marked_pic";

View file

@ -346,10 +346,6 @@ function toggleSelectListRow2(sender) {
return toggleSelectRow(sender, row);
}
function tSR(sender, row) {
return toggleSelectRow(sender, row);
}
/* this is for dijit Checkbox */
function toggleSelectRow2(sender, row) {

View file

@ -786,10 +786,10 @@ function hotkey_handler(e) {
if (keycode == 9) { // tab
var id = getArticleUnderPointer();
if (id) {
var cb = $("RCHK-" + id);
var cb = dijit.byId("RCHK-" + id);
if (cb) {
cb.checked = !cb.checked;
cb.attr("checked", !cb.attr("checked"));
toggleSelectRowById(cb, "RROW-" + id);
return false;
}

View file

@ -586,16 +586,16 @@ function moveToPost(mode) {
function toggleSelected(id, force_on) {
try {
var cb = $("RCHK-" + id);
var cb = dijit.byId("RCHK-" + id);
var row = $("RROW-" + id);
if (row) {
if (row.hasClassName('Selected') && !force_on) {
row.removeClassName('Selected');
if (cb) cb.checked = false;
if (cb) cb.attr("checked", false);
} else {
row.addClassName('Selected');
if (cb) cb.checked = true;
if (cb) cb.attr("checked", true);
}
}
} catch (e) {
@ -881,52 +881,52 @@ function selectArticles(mode) {
children.each(function(child) {
var id = child.id.replace("RROW-", "");
var cb = $("RCHK-" + id);
var cb = dijit.byId("RCHK-" + id);
if (mode == "all") {
child.addClassName("Selected");
cb.checked = true;
cb.attr("checked", true);
} else if (mode == "unread") {
if (child.hasClassName("Unread")) {
child.addClassName("Selected");
cb.checked = true;
cb.attr("checked", true);
} else {
child.removeClassName("Selected");
cb.checked = false;
cb.attr("checked", false);
}
} else if (mode == "marked") {
var img = $("FMPIC-" + child.id.replace("RROW-", ""));
if (img && img.src.match("mark_set")) {
child.addClassName("Selected");
cb.checked = true;
cb.attr("checked", true);
} else {
child.removeClassName("Selected");
cb.checked = false;
cb.attr("checked", false);
}
} else if (mode == "published") {
var img = $("FPPIC-" + child.id.replace("RROW-", ""));
if (img && img.src.match("pub_set")) {
child.addClassName("Selected");
cb.checked = true;
cb.attr("checked", true);
} else {
child.removeClassName("Selected");
cb.checked = false;
cb.attr("checked", false);
}
} else if (mode == "invert") {
if (child.hasClassName("Selected")) {
child.removeClassName("Selected");
cb.checked = false;
cb.attr("checked", false);
} else {
child.addClassName("Selected");
cb.checked = true;
cb.attr("checked", true);
}
} else {
child.removeClassName("Selected");
cb.checked = false;
cb.attr("checked", false);
}
});
@ -1751,10 +1751,10 @@ function isCdmMode() {
function markHeadline(id) {
var row = $("RROW-" + id);
if (row) {
var check = $("RCHK-" + id);
var check = dijit.byId("RCHK-" + id);
if (check) {
check.checked = true;
check.attr("checked", true);
}
row.addClassName("Selected");

View file

@ -653,6 +653,7 @@ span.hlFeed a:hover {
img.markedPic {
cursor : pointer;
vertical-align : middle;
}
a.warning {