CRM-12910 - logButton.tpl - Construct dialog HTML on demand
authorTim Otten <totten@civicrm.org>
Tue, 6 Aug 2013 23:53:50 +0000 (16:53 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 6 Aug 2013 23:53:50 +0000 (16:53 -0700)
----------------------------------------
* CRM-12910: Display revision history for each item under "Job"
  http://issues.civicrm.org/jira/browse/CRM-12910

templates/CRM/common/logButton.tpl

index 5c9568ae737e358e0afbeab5eba25c4d1f81c647..02bae2a2967705d350cf8bc4d834b4ea187ba32f 100644 (file)
@@ -37,9 +37,6 @@
 *}
 
 <a class="css_right {$snippet.css_class}" href="#" title="{ts}View Revisions{/ts}">View Revisions</a>
-<div class="dialog-{$snippet.css_class}">
-  <div class="revision-content"></div>
-</div>
 
 {literal}
 <script type="text/javascript">
@@ -47,6 +44,8 @@
 (function($, CRM) {
   $.fn.crmRevisionLink = function(options) {
     return this.each(function(){
+      var $dialog = $('<div class="'+options.cssDialogSelector.substr(1)+'"><div class="revision-content"></div></div>');
+      $('body').append($dialog);
       $(this).on("click", function() {
         $(options.cssDialogSelector).show( );
         $(options.cssDialogSelector).dialog({