-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Shows prettified JSON in modal dialog - Adds download link for JSON Fixes #1060
- Loading branch information
1 parent
aa10062
commit b81fcc9
Showing
6 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,4 +156,12 @@ | |
max-width: 75%; | ||
} | ||
|
||
.modal-header .save { | ||
float: right; | ||
margin-right: 5px; | ||
} | ||
|
||
.save { | ||
opacity: 0.2; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {component} from 'flightjs'; | ||
|
||
export default component(function jsonPanel() { | ||
this.show = function(e, data) { | ||
this.$node.find('.modal-title').text(data.title); | ||
|
||
this.$node.find('.save').attr('href', data.link); | ||
this.$node.find('.modal-body pre').text(JSON.stringify(data.obj, null, 2)); | ||
this.$node.modal('show'); | ||
}; | ||
|
||
this.after('initialize', function() { | ||
this.$node.modal('hide'); | ||
this.on(document, 'uiRequestJsonPanel', this.show); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters