On mobile, keep topic map collapsed by default. Also, when collapsed don't show as many

data turds.
This commit is contained in:
Robin Ward 2013-11-28 11:45:16 -05:00
parent 1cc72d564f
commit 488e9ca9dd
4 changed files with 14 additions and 16 deletions

View File

@ -19,7 +19,7 @@ Discourse.TopicMapComponent = Ember.Component.extend({
this._super(); this._super();
// If the topic has a summary, expand the map by default // If the topic has a summary, expand the map by default
this.set('mapCollapsed', !this.get('topic.has_summary')); this.set('mapCollapsed', Discourse.Mobile.mobileView || (!this.get('topic.has_summary')));
}, },
toggleMapClass: function() { toggleMapClass: function() {

View File

@ -4,7 +4,7 @@
</button> </button>
</nav> </nav>
<section class='map collapsed'> <section {{bindAttr class=":map mapCollapsed"}}>
<ul class="clearfix"> <ul class="clearfix">
<li> <li>
<a href='{{unbound topic.url}}'> <a href='{{unbound topic.url}}'>
@ -24,22 +24,22 @@
<h4>{{i18n posts}}</h4> <h4>{{i18n posts}}</h4>
{{number topic.posts_count}} {{number topic.posts_count}}
</li> </li>
<li> <li class='secondary'>
<h4>{{i18n views}}</h4> <h4>{{i18n views}}</h4>
{{number topic.views}} {{number topic.views}}
</li> </li>
<li> <li class='secondary'>
<h4>{{i18n users}}</h4> <h4>{{i18n users}}</h4>
{{number topic.participant_count}} {{number topic.participant_count}}
</li> </li>
{{#if topic.like_count}} {{#if topic.like_count}}
<li> <li class='secondary'>
<h4>{{i18n likes}}</h4> <h4>{{i18n likes}}</h4>
<i class='icon icon-heart'></i> {{number topic.like_count}} <i class='icon icon-heart'></i> {{number topic.like_count}}
</li> </li>
{{/if}} {{/if}}
{{#if details.links.length}} {{#if details.links.length}}
<li> <li class='secondary'>
<h4>{{i18n links}}</h4> <h4>{{i18n links}}</h4>
{{number details.links.length}} {{number details.links.length}}
</li> </li>

View File

@ -268,8 +268,6 @@ a.star {
} }
.map { .map {
&.collapsed {
}
li { li {
float: left; float: left;
padding: 7px 11px; padding: 7px 11px;
@ -277,9 +275,7 @@ a.star {
border-right: 0; border-right: 0;
} }
} }
a, a, .number {
.number {
font-weight: bold; font-weight: bold;
line-height: 20px; line-height: 20px;
} }

View File

@ -186,9 +186,13 @@ a.star {
margin-right: 4px; margin-right: 4px;
} }
.map { .map-collapsed {
&.collapsed { .secondary {
display: none;
} }
}
.map {
li { li {
float: left; float: left;
padding: 7px 11px; padding: 7px 11px;
@ -196,9 +200,7 @@ a.star {
border-right: 0; border-right: 0;
} }
} }
a, a, .number {
.number {
font-weight: bold; font-weight: bold;
line-height: 20px; line-height: 20px;
} }