]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into master
authorEugen <eugen@zeonfederated.com>
Tue, 24 Jan 2017 20:56:06 +0000 (21:56 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Jan 2017 20:56:06 +0000 (21:56 +0100)
1  2 
app/assets/javascripts/components/components/status_content.jsx
app/assets/stylesheets/components.scss
app/controllers/api/v1/statuses_controller.rb
app/lib/formatter.rb

index 7287aa836280b39a0bda23659a9e3f0f622785d2,1ee720c9bda3058e2cf316e19055db8c42f96cf5..74b52e485c8cc4ea4cb09ff6a751f01737a1842d
@@@ -58,20 -50,23 +56,35 @@@ const StatusContent = React.createClass
      }
    },
  
-   onNormalClick (e) {
-     e.stopPropagation();
 +  onSpoilerClick (spoiler, e) {
 +    if (e.button === 0) {
 +      //only toggle if we're not clicking a visible link
 +      var hasClass = $(spoiler).hasClass('spoiler-on');
 +      if (hasClass || e.target === spoiler) {
 +        e.stopPropagation();
 +        e.preventDefault();
 +        $(spoiler).siblings(".spoiler").andSelf().toggleClass('spoiler-on', !hasClass);
 +      }
 +    }
 +  },
 +
+   handleMouseDown (e) {
+     this.startXY = [e.clientX, e.clientY];
+   },
+   handleMouseUp (e) {
+     const [ startX, startY ] = this.startXY;
+     const [ deltaX, deltaY ] = [Math.abs(e.clientX - startX), Math.abs(e.clientY - startY)];
+     if (e.target.localName === 'a' || (e.target.parentNode && e.target.parentNode.localName === 'a')) {
+       return;
+     }
+     if (deltaX + deltaY < 5) {
+       this.props.onClick();
+     }
+     this.startXY = null;
    },
  
    render () {
index 681259861af2d50b5577e2ab1afd80d11097a920,de6a45963363c73fe1c2fd9147d589065ac08f79..dee53dcc78351db29f143ab19a1a972b3c1dc1bd
    }
  }
  
 +.spoiler-helper {
 +  margin-bottom: -20px !important;
 +}
 +
 +.spoiler {
 +  &::before {
 +    margin-top: 20px;
 +    display: block;
 +    content: '';
 +  }
 +
 +  display: inline;
 +  cursor: pointer;
 +  border-bottom: 1px dashed white;
 +  .light & {
 +    border-bottom: 1px dashed black;
 +  }
 +
 +  &.spoiler-on {
 +    &, & * {
 +      color: transparent !important;
 +    }
 +    background: white;
 +    .light & {
 +      background: black;
 +    }
 +
 +    .emojione {
 +      opacity: 0;
 +    }
 +  }
 +}
 +
+ @import 'boost';
++
  button i.fa-retweet {
    height: 19px;
    width: 22px;
Simple merge