Skip to content

Commit

Permalink
[preview] use a lighter switch in schema model
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen1 committed Feb 16, 2015
1 parent 722e314 commit b639f60
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 47 deletions.
44 changes: 11 additions & 33 deletions app/styles/components/schema-model.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,22 @@
@import "../fonts";

.schema-model {
margin-left: 14px;
border-radius: none;

&.hidden {
display: none;
}

>header {

span, a {
font-size: 13px;
padding: .2em;
white-space: pre;
display: none;

&.pipe {
color: darken(@gray-lt, 10%);
}


&.active {
display: inline-block;
font-weight: 700;
}


&:hover {
background: rgba(255,255,255,0.5);
cursor: pointer;
}
}
}

>section {

&.json, &.model {
font-size: 14px;
padding: 0.4em;
a.toggle {
// TODO: hardcoded color
color: rgb(66, 90, 66);
text-decoration: none;
margin: 0 0.3em;
padding: 0 0.2em;
border-radius: 3px;

&:hover {
background: rgb(66, 90, 66);
color: white;
}
}
}
Expand Down
27 changes: 13 additions & 14 deletions app/templates/schema-model.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<div class="schema-model" ng-class="{hidden: !schema}">
<header>
<a ng-click="mode = 'json'" ng-class="{active: mode === 'model'}">JSON</a> <span ng-class="{active: mode === 'json'}">JSON</span>
<span class="active pipe">|</span>
<a ng-click="mode = 'model'" ng-class="{active: mode === 'json'}">Model</a> <span ng-class="{active: mode === 'model'}">Model</span>
</header>

<section class="json animate-if" ng-if="mode === 'json'" >
<json-formatter json="json" open="1"></json-formatter>
</section>
<section class="model animate-if" ng-if="mode === 'model'">
<json-schema-view schema="json" open="0"></json-schema-view>
</section>
</div>
<table class="schema-model" ng-class="{hidden: !schema}">
<tr>
<td>
<a class="toggle" ng-click="mode = mode == 'model' ? 'json' : 'model'" title="Switch to {{mode == 'model' ? 'json' : 'model'}}"></a>
</td>
<td class="json animate-if" ng-if="mode === 'json'" >
<json-formatter json="json" open="1"></json-formatter>
</td>
<td class="model animate-if" ng-if="mode === 'model'">
<json-schema-view schema="json" open="0"></json-schema-view>
</td>
</tr>
</table>

0 comments on commit b639f60

Please sign in to comment.