From: Eugen Date: Tue, 24 Jan 2017 20:56:06 +0000 (+0100) Subject: Merge branch 'master' into master X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=f8da0dd4907490f57cb14b052b767c66c95c4db3;p=mastodon.git Merge branch 'master' into master --- f8da0dd4907490f57cb14b052b767c66c95c4db3 diff --cc app/assets/javascripts/components/components/status_content.jsx index 7287aa836,1ee720c9b..74b52e485 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@@ -58,20 -50,23 +56,35 @@@ const StatusContent = React.createClass } }, + 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); + } + } + }, + - onNormalClick (e) { - e.stopPropagation(); + 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 () { diff --cc app/assets/stylesheets/components.scss index 681259861,de6a45963..dee53dcc7 --- a/app/assets/stylesheets/components.scss +++ b/app/assets/stylesheets/components.scss @@@ -666,39 -676,8 +679,42 @@@ } } +.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;