}
},
- 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 () {
}
}
+.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;