From: Coleman Watts Date: Wed, 25 Feb 2015 14:12:20 +0000 (-0500) Subject: API Explorer minor fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=65f22b4b23df21a5107c9b0ebdf17e7be4933aba;p=civicrm-core.git API Explorer minor fixes --- diff --git a/templates/CRM/Admin/Page/APIExplorer.js b/templates/CRM/Admin/Page/APIExplorer.js index 5d3276e649..7fe6b73221 100644 --- a/templates/CRM/Admin/Page/APIExplorer.js +++ b/templates/CRM/Admin/Page/APIExplorer.js @@ -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()), @@ -599,7 +600,7 @@ prettyPrint('#example-result'); }); } else { - $('#example-result').text($('#example-result').attr('title')); + $('#example-result').text($('#example-result').attr('placeholder')); } } @@ -610,9 +611,9 @@ 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(); }); } @@ -634,7 +635,7 @@ prettyPrint('.api-doc-code pre'); }); } else { - $('#doc-result').html($('#doc-result').attr('title')); + $('#doc-result').html(entityDoc); } } diff --git a/templates/CRM/Admin/Page/APIExplorer.tpl b/templates/CRM/Admin/Page/APIExplorer.tpl index 28e05dbef1..76f87483a0 100644 --- a/templates/CRM/Admin/Page/APIExplorer.tpl +++ b/templates/CRM/Admin/Page/APIExplorer.tpl @@ -39,11 +39,13 @@ 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; @@ -210,7 +212,7 @@ -
+
 {ts}Results are displayed here.{/ts}
 
@@ -232,7 +234,7 @@ -
+
{ts}Results are displayed here.{/ts}