Skip to content

Commit

Permalink
feat(plugin): full JSON visible in modal popup
Browse files Browse the repository at this point in the history
Closes #5729
  • Loading branch information
alyec committed Apr 21, 2015
1 parent 8334a4b commit 6a72a73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/css/details-panel/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
@import "no-sidepanel.less";
@import "full-data.less";

.mfp-content {
.json-details {
display: block !important;
}
}

.sub-panel-container { // panel that slides out to display more data
position: fixed;
overflow-x: hidden;
Expand Down
2 changes: 1 addition & 1 deletion src/js/plugins/jsonParse.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RAMP.plugins.featureInfoParser.jsonParse = function (data, layerId) {
}

summary = Object.keys(data).filter(function (e) { return typeof data[e] !== 'object' && typeof data[e] !== 'undefined'; }).map(function (e) { return '<tr><th>{0}</th><td style="padding-left: 1em">{1}</td></tr>'.format(e, data[e]); }).join('');
txArea = '<textarea style="display: none">{0}</textarea>'.format(JSON.stringify(data));
txArea = '<textarea class="json-details" style="display: none">{0}</textarea>'.format(JSON.stringify(data));

return '<table>{0}</table>{1}'.format(summary,txArea);
};

0 comments on commit 6a72a73

Please sign in to comment.