diff --git a/js/paragraphs.admin.js b/js/paragraphs.admin.js
index 779fe0d..a50be5c 100644
--- a/js/paragraphs.admin.js
+++ b/js/paragraphs.admin.js
@@ -8,59 +8,73 @@
    * @type {Drupal~behavior}
    */
   Drupal.behaviors.bodyTabs = {
-    attach: function (context, settings) {
-      /** Set content fields to visible when tabs are created. After an action
-       * being performed, stay on the same perspective. **/
-      if($(context).find('.layout-region-node-main').hasClass('behavior-active')) {
-        $(context).find('.layout-region-node-main').removeClass('content-active');
-        $(context).find('.layout-region-node-main').addClass('behavior-active');
-        $(context).find('.paragraphs-tabs').find('#content').removeClass('is-active');
-        $(context).find('.paragraphs-tabs').find('#behavior').addClass('is-active');
-        $('.paragraphs-content').hide();
-        $('.paragraphs-behavior').show();
-      }
-      else {
-        /** Activate content tab visually if there is no previously activated
-         * tab. */
-        if (!($(context).find('.layout-region-node-main').hasClass('content-active')) && !($(context).find('.layout-region-node-main').hasClass('behavior-active'))) {
-          $(context).find('.paragraphs-tabs').find('#content').addClass('is-active');
-          $(context).find('.layout-region-node-main').addClass('content-active');
+    attach: function (context) {
+      var $parWidgets = $('.paragraphs-tabs-wrapper', context).once('paragraphs-bodytabs');
+      $parWidgets.each(function() {
+        var $parWidget = $(this);
+        var $parTabs = $parWidget.find('.paragraphs-tabs');
+        var $parContent = $parWidget.find('.paragraphs-content');
+        var $parBehavior = $parWidget.find('.paragraphs-behavior');
+        var $mainRegion = $parWidget.find('.layout-region-node-main');
+        var $tabContent = $parTabs.find('#content');
+        var $tabBehavior = $parTabs.find('#behavior');
+
+        /* Set content fields to visible when tabs are created. After an
+           action being performed, stay on the same perspective. */
+        if ($parWidget.hasClass('behavior-active')) {
+          $parWidget.removeClass('content-active');
+          $parWidget.addClass('behavior-active');
+          $tabContent.removeClass('is-active');
+          $tabBehavior.addClass('is-active');
+          $parContent.hide();
+          $parBehavior.show();
+        }
+        else {
+          /* Activate content tab visually if there is no previously
+           activated tab. */
+          if (!($mainRegion.hasClass('content-active'))
+            && !($mainRegion.hasClass('behavior-active'))) {
+            $tabContent.addClass('is-active');
+            $mainRegion.addClass('content-active');
+          }
+
+          $parContent.show();
+          $parBehavior.hide();
         }
-        $('.paragraphs-content').show();
-        $('.paragraphs-behavior').hide();
-      }
-      /** Checking the number of behavior elements and showing tabs only if there
-       * are behavior elements.
-       */
-      if($('.paragraphs-behavior').length != 0) {
-        $(context).find('.paragraphs-tabs-wrapper').find('.paragraphs-tabs').show();
-      }
-      else {
-        $(context).find('.paragraphs-tabs-wrapper').find('.paragraphs-tabs').hide();
-      }
-      /** Create click event. **/
-      $(context).find('.paragraphs-tabs').find('a').click(function(e) {
-        e.preventDefault();
-        /** Switching active class between tabs. */
-        var el = jQuery(this);
-        $(context).find('.paragraphs-tabs').find('li').removeClass('is-active');
-        el.parent('li').addClass('is-active');
-        $(context).find('.layout-region-node-main').removeClass('behavior-active');
-        $(context).find('.layout-region-node-main').removeClass('content-active');
-        $(context).find('.paragraphs-tabs-wrapper').removeClass('is-active');
-        $(context).find(el.attr('href')).addClass('is-active');
-        /** Show/Hide fields based on current active class. */
-        if($(context).find('.paragraphs-tabs-wrapper').find('#content').hasClass('is-active')) {
-          $(context).find('.layout-region-node-main').addClass('content-active');
-          $('.paragraphs-content').show();
-          $('.paragraphs-behavior').hide();
+
+        /* Checking the number of behavior elements and showing tabs only if
+          there are behavior elements. */
+        if ($parBehavior.length != 0) {
+          $parTabs.show();
         }
-        if($(context).find('.paragraphs-tabs-wrapper').find('#behavior').hasClass('is-active')) {
-          $(context).find('.layout-region-node-main').addClass('behavior-active');
-          $('.paragraphs-content').hide();
-          $('.paragraphs-behavior').show();
+        else {
+          $parTabs.hide();
         }
-      } );
+
+        /* Create click event. */
+        $parTabs.find('a').click(function(e) {
+          e.preventDefault();
+          /* Switching active class between tabs. */
+          var el = jQuery(this);
+          $parTabs.find('li').removeClass('is-active');
+          el.parent('li').addClass('is-active');
+          $mainRegion.removeClass('behavior-active content-active is-active');
+          $($parWidget).find(el.attr('href')).addClass('is-active');
+
+          /* Show/Hide fields based on current active class. */
+          if ($parWidget.find('#content').hasClass('is-active')) {
+            $mainRegion.addClass('content-active');
+            $parContent.show();
+            $parBehavior.hide();
+          }
+
+          if ($parWidget.find('#behavior').hasClass('is-active')) {
+            $mainRegion.addClass('behavior-active');
+            $parContent.hide();
+            $parBehavior.show();
+          }
+        });
+      });
     }
   };
 
