summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2018-08-11 08:21:42 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2018-08-11 08:21:42 +0000
commit06ccdba84c4323c137786bb200f8ac4add6ac08e (patch)
treee03c1d253d664415e35024219da598c51f8ddece
parent13e13f769d1a09744fb075eca8b337491c185719 (diff)
- Optimierung Bilderauswahl sendeet bei mehreren Bilder nur noch eine Anfrage
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7098 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/produkt/images.phtml27
1 files changed, 14 insertions, 13 deletions
diff --git a/views/produkt/images.phtml b/views/produkt/images.phtml
index 247b9f9..88522b4 100644
--- a/views/produkt/images.phtml
+++ b/views/produkt/images.phtml
@@ -189,6 +189,8 @@
//loop through the array and do things with each attachment
var i, attachment;
+ var arPostID = [];
+
for (i = 0; i < attachments.length; ++i) {
attachment = attachments[i];
@@ -196,23 +198,22 @@
attachment = attachment.toJSON();
- console.log(attachment);
+ arPostID.push(attachment.id);
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&cmd=upload&noheader=1&edit_id=<?php echo $this->view['data']['id']; ?>',
- async: true,
- data: {
- post_id: attachment.id
- },
- success: function(data) {
-
- jQuery('#produktbilder_target_MT').html(data);
+ }
- }
- } );
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&cmd=upload&noheader=1&edit_id=<?php echo $this->view['data']['id']; ?>',
+ async: true,
+ data: {
+ post_id: arPostID
+ },
+ success: function(data) {
+ jQuery('#produktbilder_target_MT').html(data);
- }
+ }
+ } );
});