Commit 94e2400e authored by Augusto Fagioli's avatar Augusto Fagioli
Browse files
parent 7c83af34
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -24,8 +24,9 @@
                // Prevent default click on rotate icon
                e.preventDefault();
                // Current rotate value and thumbnail image
                var rotate = parseInt($(this).attr("data-rotate")),
                $image = $(this).closest(".image-widget").find("img");
                var rotate = parseInt($(this).attr("data-rotate"));
                $image = $(this).closest(".image-widget").find("img")
                    .add($(this).closest(".media-library-add-form li").find('[data-drupal-selector="edit-preview"] img'));
                // Rotate Input
                $rotate_input = $(this).closest(".image-widget").find('.rotate');
                // Remove current rotate CSS class
+16 −0
Original line number Diff line number Diff line
diff --git a/js/simple_image_rotate.js b/js/simple_image_rotate.js
index ffa00bc..e0906f7 100644
--- a/js/simple_image_rotate.js
+++ b/js/simple_image_rotate.js
@@ -24,8 +24,9 @@
                 // Prevent default click on rotate icon
                 e.preventDefault();
                 // Current rotate value and thumbnail image
-                var rotate = parseInt($(this).attr("data-rotate")),
-                $image = $(this).closest(".image-widget").find("img");
+                var rotate = parseInt($(this).attr("data-rotate"));
+                $image = $(this).closest(".image-widget").find("img")
+                    .add($(this).closest(".media-library-add-form li").find('[data-drupal-selector="edit-preview"] img'));
                 // Rotate Input
                 $rotate_input = $(this).closest(".image-widget").find('.rotate');
                 // Remove current rotate CSS class
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ function simple_image_rotate_field_widget_multivalue_form_alter(array &$elements
        // Add rotate icon and hidden rotate field.
        $elements[$key]['rotate'] = [
          '#type' => 'hidden',
          '#attributes' => ['class' => 'rotate'],
          '#attributes' => ['class' => ['rotate']],
          '#value' => 0,
        ];