diff --git a/static/js/apiDialog.js b/static/js/apiDialog.js
index ba49ba1e6..6294e9fba 100644
--- a/static/js/apiDialog.js
+++ b/static/js/apiDialog.js
@@ -169,35 +169,26 @@ pandora.ui.apiDialog = function() {
if (id && actions[id]) {
$text.html('
' + id + '
');
var code = actions[id].code[1],
- f = actions[id].code[0],
- line = Math.round(Ox.last(f.split(':')) || 0),
+ source = actions[id].code[0],
+ line = Math.round(Ox.last(source.split(':')) || 0),
doc = actions[id].doc.replace('/\n/
\n/g'),
$code, $doc;
-
$doc = Ox.SyntaxHighlighter({
source: doc,
})
.appendTo($text);
-
- Ox.Button({
- title: Ox._('Source ({0})', [f]),
- }).bindEvent({
- click: function() {
- $code.toggle();
- }
- })
- .css({
- margin: '4px'
- })
+ $('
')
+ .html('' + source + '')
.appendTo($text);
$code = Ox.SyntaxHighlighter({
- showLineNumbers: true,
- source: code,
- offset: line
- })
- .css({
- borderWidth: '1px',
- }).appendTo($text);
+ showLineNumbers: true,
+ source: code.replace(/\s+?'''.+?'''\n/g, ''),
+ offset: line
+ })
+ .css({
+ borderWidth: '1px',
+ })
+ .appendTo($text);
} else {
$text.empty().append(getIndex());
}