]> cat aescling's git repositories - mastodon.git/commitdiff
Fix column design broken with very long title (#5493)
authorりんすき <6533808+rinsuki@users.noreply.github.com>
Thu, 26 Oct 2017 13:52:48 +0000 (22:52 +0900)
committerunarist <m.unarist@gmail.com>
Thu, 26 Oct 2017 13:52:48 +0000 (22:52 +0900)
* Fix #5314

* fix not beautiful code

* fix broken design with mobile view

* remove no longer needed code

app/javascript/mastodon/components/column_header.js
app/javascript/styles/mastodon/components.scss

index e4fa8fa7a7f5caa4f9a7592a199a6ca85a3f04ec..80a8fbdb3a635f926ab81d0c00080ed05b8f3fef 100644 (file)
@@ -137,7 +137,9 @@ export default class ColumnHeader extends React.PureComponent {
       <div className={wrapperClassName}>
         <h1 tabIndex={focusable ? 0 : null} role='button' className={buttonClassName} aria-label={title} onClick={this.handleTitleClick}>
           <i className={`fa fa-fw fa-${icon} column-header__icon`} />
-          {title}
+          <span className='column-header__title'>
+            {title}
+          </span>
 
           <div className='column-header__buttons'>
             {backButton}
index d7216cd1db644d83ff1f096de33b4151e25bdd7a..516f8de7d13bc7e401a2fd3fc60156f883a0f732 100644 (file)
@@ -2280,6 +2280,7 @@ button.icon-button.active i.fa-retweet {
 }
 
 .column-header {
+  display: flex;
   padding: 15px;
   font-size: 16px;
   background: lighten($ui-base-color, 4%);
@@ -2305,12 +2306,10 @@ button.icon-button.active i.fa-retweet {
 }
 
 .column-header__buttons {
-  position: absolute;
-  right: 0;
-  top: 0;
-  height: 100%;
-  display: flex;
   height: 48px;
+  display: flex;
+  margin: -15px;
+  margin-left: 0;
 }
 
 .column-header__button {
@@ -2378,6 +2377,14 @@ button.icon-button.active i.fa-retweet {
   }
 }
 
+.column-header__title {
+  display: inline-block;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  flex: 1;
+}
+
 .text-btn {
   display: inline-block;
   padding: 0;