HR-316 - Add crmRegion support to snippets and remove old div
authorColeman Watts <coleman@civicrm.org>
Fri, 11 Apr 2014 21:52:27 +0000 (17:52 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 11 Apr 2014 21:52:27 +0000 (17:52 -0400)
js/crm.designerapp.js
templates/CRM/common/snippet.tpl

index d0a0c1aa33a9541c49d82cbe00a9a0219e6a0c49..840d98a8e9b753d6119a00bc5cfbb994045ab8e9 100644 (file)
@@ -16,7 +16,7 @@
      * @see CRM-12188
      */
     CRM.designerApp.clearPreviewArea = function () {
-      $('.crm-profile-selector-preview-pane > .crm-container-snippet').each(function () {
+      $('.crm-profile-selector-preview-pane > *').each(function () {
         var parent = $(this).parent();
         CRM.designerApp.DetachedProfiles.push({
           parent: parent,
index 90ac29a133888402c80d8749849911b04020d006..98e3686c74c5591c050002703b2206690e300466 100644 (file)
     {if $smarty.get.snippet eq 2}
       {include file="CRM/common/print.tpl"}
     {else}
-      <div class="crm-container-snippet">
+      {crmRegion name='page-body'}
 
-        {* Display Status messages unless we are outputting json. *}
+        {* Add status messages and container-snippet div unless we are outputting json. *}
         {if $smarty.get.snippet neq 'json'}
+          {* this div is deprecated but included for older-style snippets for legacy support *}
+          <div class="crm-container-snippet">
           {include file="CRM/common/status.tpl"}
         {/if}
 
           {include file=$tplFile}
         {/if}
 
-      </div> {* end crm-container-snippet div *}
+        {if $smarty.get.snippet neq 'json'}
+          </div>
+        {/if}
+
+      {/crmRegion}
     {/if}
   {/if}
 {/strip}