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'] .= "<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\">"; id=\"RCHK-$id\">";
$reply['content'] .= "$marked_pic"; $reply['content'] .= "$marked_pic";

View File

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

View File

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

View File

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

View File

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