Browse Source

Fix add and remove artists buttons

tricidious 7 years ago
parent
commit
c7e2fc98b6
3 changed files with 7 additions and 7 deletions
  1. 2
    2
      static/functions/browse.js
  2. 2
    2
      static/functions/requests.js
  3. 3
    3
      static/functions/upload.js

+ 2
- 2
static/functions/browse.js View File

@@ -313,6 +313,6 @@ $(function() {
313 313
     var a = $('a[data-cover]')[0]
314 314
     if (a) preload(a.attributes['data-cover'].value)
315 315
   }
316
-  $('.add_artist_button').each(function(i, el) {el.addEventListener('click', AddArtistField)})
317
-  $('.remove_artist_button').each(function(i, el) {el.addEventListener('click', RemoveArtistField)})
316
+  $(document).on('click', '.add_artist_button', AddArtistField);
317
+  $(document).on('click', '.remove_artist_button', RemoveArtistField);
318 318
 })

+ 2
- 2
static/functions/requests.js View File

@@ -239,6 +239,6 @@ $(function() {
239 239
       ({'jav':JavAutofill})[el.attributes['autofill'].value]()
240 240
     })
241 241
   })
242
-  $('.add_artist_button').each(function(i, el) {el.addEventListener('click', AddArtistField)})
243
-  $('.remove_artist_button').each(function(i, el) {el.addEventListener('click', RemoveArtistField)})
242
+  $(document).on('click', '.add_artist_button', AddArtistField);
243
+  $(document).on('click', '.remove_artist_button', RemoveArtistField);
244 244
 })

+ 3
- 3
static/functions/upload.js View File

@@ -526,7 +526,7 @@ function initAutofill() {
526 526
 }
527 527
 
528 528
 $(function() {
529
-  initAutofill()
530
-  $('.add_artist_button').each(function(i, el) {el.addEventListener('click', AddArtistField)})
531
-  $('.remove_artist_button').each(function(i, el) {el.addEventListener('click', RemoveArtistField)})
529
+  initAutofill();
530
+  $(document).on('click', '.add_artist_button', AddArtistField);
531
+  $(document).on('click', '.remove_artist_button', RemoveArtistField);
532 532
 })

Loading…
Cancel
Save