Browse Source

Fix request JS

spaghetti 8 years ago
parent
commit
eec31b22c2
2 changed files with 3 additions and 3 deletions
  1. 0
    2
      sections/requests/new_edit.php
  2. 3
    1
      static/functions/requests.js

+ 0
- 2
sections/requests/new_edit.php View File

303
 <?  } ?>
303
 <?  } ?>
304
       </table>
304
       </table>
305
     </form>
305
     </form>
306
-    <script type="text/javascript"><?=$NewRequest ? " Calculate();" : '' ?></script>
307
-    <script type="text/javascript">Categories();</script>
308
   </div>
306
   </div>
309
 </div>
307
 </div>
310
 <?
308
 <?

+ 3
- 1
static/functions/requests.js View File

55
 }
55
 }
56
 
56
 
57
 function Calculate() {
57
 function Calculate() {
58
+  if (!$('#unit').raw()) { return; }
58
   var mul = (($('#unit').raw().options[$('#unit').raw().selectedIndex].value == 'mb') ? (1024*1024) : (1024*1024*1024));
59
   var mul = (($('#unit').raw().options[$('#unit').raw().selectedIndex].value == 'mb') ? (1024*1024) : (1024*1024*1024));
59
   var amt = Math.floor($('#amount_box').raw().value * mul);
60
   var amt = Math.floor($('#amount_box').raw().value * mul);
60
   if (amt > $('#current_uploaded').raw().value) {
61
   if (amt > $('#current_uploaded').raw().value) {
232
 
233
 
233
 $(function() {
234
 $(function() {
234
   Categories()
235
   Categories()
236
+  Calculate()
235
   document.querySelectorAll('[autofill]').forEach(function(el) {
237
   document.querySelectorAll('[autofill]').forEach(function(el) {
236
     el.addEventListener('click', function(event) {
238
     el.addEventListener('click', function(event) {
237
-      ({'douj':DoujAutofill, 'anime':AnidbAutofill, 'jav':JavAutofill})[el.attributes['autofill'].value]()
239
+      ({'jav':JavAutofill})[el.attributes['autofill'].value]()
238
     })
240
     })
239
   })
241
   })
240
 })
242
 })

Loading…
Cancel
Save