API Explorer minor fixes
authorColeman Watts <coleman@civicrm.org>
Wed, 25 Feb 2015 14:12:20 +0000 (09:12 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 25 Feb 2015 14:12:20 +0000 (09:12 -0500)
templates/CRM/Admin/Page/APIExplorer.js
templates/CRM/Admin/Page/APIExplorer.tpl

index 5d3276e649e0ce9236d4c8ef5f65544c3ab8e3ae..7fe6b73221f5a92706017918e507944167eeced2 100644 (file)
@@ -10,6 +10,7 @@
     options = {},
     params = {},
     smartyStub,
+    entityDoc,
     fieldTpl = _.template($('#api-param-tpl').html()),
     optionsTpl = _.template($('#api-options-tpl').html()),
     returnTpl = _.template($('#api-return-tpl').html()),
           prettyPrint('#example-result');
         });
     } else {
-      $('#example-result').text($('#example-result').attr('title'));
+      $('#example-result').text($('#example-result').attr('placeholder'));
     }
   }
 
     CRM.utils.setOptions($('#doc-action').prop('disabled', true).addClass('loading'), []);
     $.getJSON(CRM.url('civicrm/ajax/apidoc', {entity: $(this).val()}))
       .done(function(result) {
+        entityDoc = result.doc;
         CRM.utils.setOptions($('#doc-action').prop('disabled', false).removeClass('loading'), result.actions);
         $('#doc-result').html(result.doc);
-        prettyPrint();
       });
   }
 
           prettyPrint('.api-doc-code pre');
         });
     } else {
-      $('#doc-result').html($('#doc-result').attr('title'));
+      $('#doc-result').html(entityDoc);
     }
   }
 
index 28e05dbef1f6e60b3377d5efff31606abd0ceb7a..76f87483a0842db59f50b71b1d451e848ec62127 100644 (file)
     font-size: 1.1em;
     margin-bottom: .6em;
   }
+  pre#api-result {
+    max-height: 50em;
+  }
   pre#api-result,
   div#doc-result,
   pre#example-result {
     padding:1em;
-    max-height: 50em;
     border: 1px solid lightgrey;
     margin-top: 1em;
     overflow: auto;
       <select class="crm-form-select big crm-select2" id="example-action" name="action">
         <option value="" selected="selected">{ts}Choose{/ts}...</option>
       </select>
-<pre id="example-result" class="linenums lang-php" title="{ts escape='html'}Results are displayed here.{/ts}">
+<pre id="example-result" class="linenums lang-php" placeholder="{ts escape='html'}Results are displayed here.{/ts}">
 {ts}Results are displayed here.{/ts}
 </pre>
     </form>
       <select class="crm-form-select big crm-select2" id="doc-action" name="action">
         <option value="" selected="selected">{ts}Choose{/ts}...</option>
       </select>
-      <div id="doc-result" title="{ts escape='html'}Results are displayed here.{/ts}">
+      <div id="doc-result">
         {ts}Results are displayed here.{/ts}
       </div>
     </form>