summaryrefslogtreecommitdiff
path: root/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-20 17:48:38 +0100
committerAndrew Dolgov <[email protected]>2009-01-20 17:48:38 +0100
commit8f70815592e1647e659e5005c508a5869a148b60 (patch)
tree3e5f6494ccc4f476c57f44448c976e79d8faabfc /prefs.js
parent62f7bf71811178be003927c305873e62f3ac7119 (diff)
category editor: properly initialize inline editors
Diffstat (limited to 'prefs.js')
-rw-r--r--prefs.js38
1 files changed, 23 insertions, 15 deletions
diff --git a/prefs.js b/prefs.js
index ee5a814c6..9d46cde2b 100644
--- a/prefs.js
+++ b/prefs.js
@@ -240,24 +240,32 @@ function changepass_callback() {
}
}
-function infobox_feed_cat_callback() {
- if (xmlhttp.readyState == 4) {
- try {
-
- infobox_callback();
-
- if (document.getElementById("prefFeedCatList")) {
- var elems = document.getElementById("prefFeedCatList").getElementsByTagName("SPAN");
+function init_cat_inline_editor() {
+ try {
- for (var i = 0; i < elems.length; i++) {
- if (elems[i].id && elems[i].id.match("FCATT-")) {
- var cat_id = elems[i].id.replace("FCATT-", "");
+ if (document.getElementById("prefFeedCatList")) {
+ var elems = document.getElementById("prefFeedCatList").getElementsByTagName("SPAN");
+ for (var i = 0; i < elems.length; i++) {
+ if (elems[i].id && elems[i].id.match("FCATT-")) {
+ var cat_id = elems[i].id.replace("FCATT-", "");
new Ajax.InPlaceEditor(elems[i],
- 'backend.php?op=pref-feeds&subop=editCats&action=save&cid=' + cat_id);
- }
+ 'backend.php?op=pref-feeds&subop=editCats&action=save&cid=' + cat_id);
}
}
+ }
+
+ } catch (e) {
+ exception_error("init_cat_inline_editor", e);
+ }
+}
+
+function infobox_feed_cat_callback() {
+ if (xmlhttp.readyState == 4) {
+ try {
+
+ infobox_callback();
+ init_cat_inline_editor();
} catch (e) {
exception_error("infobox_feed_cat_callback", e);
@@ -388,7 +396,7 @@ function addFeedCat() {
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=add&cat=" +
param_escape(cat.value), true);
- xmlhttp.onreadystatechange=infobox_callback;
+ xmlhttp.onreadystatechange=infobox_feed_cat_callback;
xmlhttp.send(null);
link.value = "";
@@ -763,7 +771,7 @@ function removeSelectedFeedCats() {
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=remove&ids="+
param_escape(sel_rows.toString()), true);
- xmlhttp.onreadystatechange=infobox_callback;
+ xmlhttp.onreadystatechange=infobox_feed_cat_callback;
xmlhttp.send(null);
}