Browse Source

Fix some cases where BBCode toolbars would fail to be recreated after page is modified

spaghetti 7 years ago
parent
commit
f39fc7bfd8
2 changed files with 3 additions and 1 deletions
  1. 2
    1
      static/functions/comments.js
  2. 1
    0
      static/functions/upload.js

+ 2
- 1
static/functions/comments.js View File

@@ -153,7 +153,7 @@ function Preview_Edit(postid) {
153 153
   ajax.post("ajax.php?action=preview","form" + postid, function(response) {
154 154
     $('#preview' + postid).raw().innerHTML = response;
155 155
     $('#editbox' + postid).ghide();
156
-    if ($('#editbox' + postid).raw().previousSibling.className == 'bbcode_bar') $($('#editbox' + postid).raw().previousSibling).ghide();
156
+    if ($('#editbox' + postid).raw().previousSibling.classList.contains('bbcode_bar')) $($('#editbox' + postid).raw().previousSibling).ghide();
157 157
   });
158 158
 }
159 159
 
@@ -161,6 +161,7 @@ function Cancel_Preview(postid) {
161 161
   $('#bar' + postid).raw().innerHTML = "<input type=\"button\" value=\"Preview\" onclick=\"Preview_Edit(" + postid + ");\" /><input type=\"button\" value=\"Post\" onclick=\"Save_Edit(" + postid + ")\" /><input type=\"button\" value=\"Cancel\" onclick=\"Cancel_Edit(" + postid + ");\" />";
162 162
   $('#preview' + postid).raw().innerHTML = "";
163 163
   $('#editbox' + postid).gshow();
164
+  if ($('#editbox' + postid).raw().previousSibling.classList.contains('bbcode_bar')) $($('#editbox' + postid).raw().previousSibling).gshow();
164 165
 }
165 166
 
166 167
 function Save_Edit(postid) {

+ 1
- 0
static/functions/upload.js View File

@@ -47,6 +47,7 @@ function Categories() {
47 47
     }
48 48
     initAutocomplete()
49 49
     initAutofill()
50
+    $('.bbcode_editor').each(function(i, el) { BBEditor(el) })
50 51
   });
51 52
 }
52 53
 

Loading…
Cancel
Save