summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-02 10:16:25 +0300
committerAndrew Dolgov <[email protected]>2018-12-02 10:16:25 +0300
commit2f85b50e3607b2b159989c493ac8f8c46a389559 (patch)
tree72117372f2e4940d923e953dd68596c32937fbf5
parent8ea3a75df02fdf8ccfea6ca32965a1d407f089b6 (diff)
remove toggleSelectListRow2()
-rwxr-xr-xclasses/pref/filters.php4
-rw-r--r--include/feedbrowser.php8
-rwxr-xr-xjs/functions.js19
3 files changed, 15 insertions, 16 deletions
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index e60628f8f..e48615395 100755
--- a/classes/pref/filters.php
+++ b/classes/pref/filters.php
@@ -429,7 +429,7 @@ class Pref_Filters extends Handler_Protected {
$data = htmlspecialchars(json_encode($line));
- print "<li><input dojoType='dijit.form.CheckBox' type='checkbox' onclick='toggleSelectListRow2(this)'>".
+ print "<li><input dojoType='dijit.form.CheckBox' type='checkbox' onclick='ListUtils.onChecked(this)'>".
"<span onclick=\"dijit.byId('filterEditDlg').editRule(this)\">".$this->getRuleName($line)."</span>".
"<input type='hidden' name='rule[]' value=\"$data\"/></li>";
}
@@ -473,7 +473,7 @@ class Pref_Filters extends Handler_Protected {
$data = htmlspecialchars(json_encode($line));
- print "<li><input dojoType='dijit.form.CheckBox' type='checkbox' onclick='toggleSelectListRow2(this)'>".
+ print "<li><input dojoType='dijit.form.CheckBox' type='checkbox' onclick='ListUtils.onChecked(this)'>".
"<span onclick=\"dijit.byId('filterEditDlg').editAction(this)\">".$this->getActionName($line)."</span>".
"<input type='hidden' name='action[]' value=\"$data\"/></li>";
}
diff --git a/include/feedbrowser.php b/include/feedbrowser.php
index 8ebeb20cc..a0b1b6e8f 100644
--- a/include/feedbrowser.php
+++ b/include/feedbrowser.php
@@ -53,12 +53,10 @@
$site_url = htmlspecialchars($line["site_url"]);
$subscribers = $line["subscribers"];
- $check_box = "<input onclick='toggleSelectListRow2(this)'
+ $check_box = "<input onclick='ListUtils.onChecked(this)'
dojoType=\"dijit.form.CheckBox\"
type=\"checkbox\" \">";
- $class = ($feedctr % 2) ? "even" : "odd";
-
$site_url = "<a target=\"_blank\" rel=\"noopener noreferrer\"
href=\"$site_url\">
<span class=\"fb_feedTitle\">".
@@ -75,11 +73,9 @@
$feed_url = htmlspecialchars($line["feed_url"]);
$site_url = htmlspecialchars($line["site_url"]);
- $check_box = "<input onclick='toggleSelectListRow2(this)' dojoType=\"dijit.form.CheckBox\"
+ $check_box = "<input onclick='ListUtils.onChecked(this)' dojoType=\"dijit.form.CheckBox\"
type=\"checkbox\">";
- $class = ($feedctr % 2) ? "even" : "odd";
-
if ($line['articles_archived'] > 0) {
$archived = sprintf(_ngettext("%d archived article", "%d archived articles", (int) $line['articles_archived']), $line['articles_archived']);
$archived = "&nbsp;<span class='subscribers'>($archived)</span>";
diff --git a/js/functions.js b/js/functions.js
index 59912905d..ce6d7aca9 100755
--- a/js/functions.js
+++ b/js/functions.js
@@ -53,6 +53,15 @@ Array.prototype.remove = function(s) {
}
};
+const ListUtils = {
+ onChecked: function(elem) {
+ // account for dojo checkboxes
+ elem = elem.domNode || elem;
+
+ elem.up("li").toggleClassName("Selected");
+ }
+};
+
const Utils = {
_rpc_seq: 0,
hotkey_prefix: 0,
@@ -985,12 +994,6 @@ function toggleSelectRowById(sender, id) {
}
/* this is for dijit Checkbox */
-function toggleSelectListRow2(sender) {
- const row = sender.domNode.parentNode;
- return toggleSelectRow(sender, row);
-}
-
-/* this is for dijit Checkbox */
function toggleSelectRow2(sender, row, is_cdm) {
if (!row)
@@ -1137,7 +1140,7 @@ const Filters = {
new dijit.form.CheckBox({
onChange: function () {
- this.domNode.up("li").toggleClassName("Selected");
+ ListUtils.onChecked(this);
},
}, cb);
@@ -1186,7 +1189,7 @@ const Filters = {
new dijit.form.CheckBox({
onChange: function () {
- this.domNode.up("li").toggleClassName("Selected");
+ ListUtils.onChecked(this);
},
}, cb);