diff --git a/app/assets/javascripts/discourse/controllers/quote_button_controller.js b/app/assets/javascripts/discourse/controllers/quote_button_controller.js index 8c1b9110ac8..c6e4ceb7e58 100644 --- a/app/assets/javascripts/discourse/controllers/quote_button_controller.js +++ b/app/assets/javascripts/discourse/controllers/quote_button_controller.js @@ -45,9 +45,7 @@ Discourse.QuoteButtonController = Discourse.Controller.extend({ cloned = range.cloneRange(), $ancestor = $(range.commonAncestorContainer); - // don't display the "quote reply" button if you select text spanning two posts - // note: the ".contents" is here to prevent selection of the topic summary - if ($ancestor.closest('.topic-body > .contents').length === 0) { + if ($ancestor.closest('.cooked').length === 0) { this.set('buffer', ''); return; } diff --git a/app/assets/javascripts/discourse/lib/utilities.js b/app/assets/javascripts/discourse/lib/utilities.js index e2e3060945b..45a712d1387 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js +++ b/app/assets/javascripts/discourse/lib/utilities.js @@ -88,18 +88,18 @@ Discourse.Utilities = { var html = ''; if (typeof window.getSelection !== "undefined") { - var sel = window.getSelection(); - if (sel.rangeCount) { - var container = document.createElement("div"); - for (var i = 0, len = sel.rangeCount; i < len; ++i) { - container.appendChild(sel.getRangeAt(i).cloneContents()); - } - html = container.innerHTML; + var sel = window.getSelection(); + if (sel.rangeCount) { + var container = document.createElement("div"); + for (var i = 0, len = sel.rangeCount; i < len; ++i) { + container.appendChild(sel.getRangeAt(i).cloneContents()); } + html = container.innerHTML; + } } else if (typeof document.selection !== "undefined") { - if (document.selection.type === "Text") { - html = document.selection.createRange().htmlText; - } + if (document.selection.type === "Text") { + html = document.selection.createRange().htmlText; + } } // Strip out any .click elements from the HTML before converting it to text diff --git a/app/assets/javascripts/discourse/views/quote_button_view.js b/app/assets/javascripts/discourse/views/quote_button_view.js index 9c6d02949dc..7741ac08725 100644 --- a/app/assets/javascripts/discourse/views/quote_button_view.js +++ b/app/assets/javascripts/discourse/views/quote_button_view.js @@ -64,8 +64,8 @@ Discourse.QuoteButtonView = Discourse.View.extend({ }) .on('selectionchange', function() { // there is no need to handle this event when the mouse is down - // or if there is not a touch in progress - if (view.get('isMouseDown') || !view.get('isTouchInProgress')) return; + // or if there a touch in progress + if (view.get('isMouseDown') || view.get('isTouchInProgress')) return; // `selection.anchorNode` is used as a target view.selectText(window.getSelection().anchorNode, controller); }); diff --git a/app/assets/stylesheets/common/foundation/mixins.scss b/app/assets/stylesheets/common/foundation/mixins.scss index dbc8b5c076f..830072b3a4b 100644 --- a/app/assets/stylesheets/common/foundation/mixins.scss +++ b/app/assets/stylesheets/common/foundation/mixins.scss @@ -55,23 +55,13 @@ // Border radius @mixin border-radius-all($radius) { - border-radius: $radius; -} - -@mixin border-radius-top($radius) { - border-top-right-radius: $radius; - border-top-left-radius: $radius; -} - -@mixin border-radius-bottom($radius) { - border-bottom-right-radius: $radius; - border-bottom-left-radius: $radius; + border-radius: $radius; } // Box shadow @mixin box-shadow($shadow) { - box-shadow: $shadow; + box-shadow: $shadow; } // Linear gradient @@ -81,32 +71,6 @@ background-image: linear-gradient(to bottom, $start-color, $end-color); } -// Background size - -@mixin background-size($size) { - background-size: $size; -} - -// Background clip - -@mixin background-clip($clip) { - background-clip: $clip; -} - -// Rotate - -@mixin rotate($degrees) { - -webkit-transform: rotate($degrees); - transform: rotate($degrees); -} - -// Scale - -@mixin scale($ratio) { - -webkit-transform: scale($ratio); - transform: scale($ratio); -} - // Transition @mixin transition($transition) { @@ -138,12 +102,6 @@ } } -@mixin fade-soft($time: 1s) { - -webkit-transition: opacity $time ease-in-out; - -ms-transition: opacity $time ease-in-out; - transition: opacity $time ease-in-out; -} - @mixin visible { opacity: 1; visibility: visible; @@ -151,16 +109,6 @@ transition-delay: 0s; } -// Decorations -// -------------------------------------------------- - -// Glow - -@mixin glow($color) { - border: 1px solid $color; - box-shadow: 0 0 5px $color; -} - // // -------------------------------------------------- diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss index bbfb05443aa..05592c8ca56 100644 --- a/app/assets/stylesheets/desktop/compose.scss +++ b/app/assets/stylesheets/desktop/compose.scss @@ -309,7 +309,7 @@ border: 1px dashed $gray; overflow: auto; visibility: visible; - + &.hidden { width: 0; visibility: hidden; @@ -432,8 +432,7 @@ div.ac-wrap { } #wmd-input, #wmd-preview { - box-sizing: border-box; - -moz-box-sizing: border-box; + @include box-sizing(border-box); width: 100%; height: 100%; min-height: 100%; @@ -453,7 +452,7 @@ div.ac-wrap { top: 0; height: 100%; min-height: 100%; - box-sizing: border-box; + @include box-sizing(border-box); border: 0; border-top: 36px solid transparent; @include border-radius-all(0); @@ -461,8 +460,7 @@ div.ac-wrap { } .textarea-wrapper, .preview-wrapper { position: relative; - box-sizing: border-box; - -moz-box-sizing: border-box; + @include box-sizing(border-box); height: 100%; min-height: 100%; margin: 0; diff --git a/app/assets/stylesheets/desktop/topic.scss b/app/assets/stylesheets/desktop/topic.scss index bbec999656b..cdaf714e1a7 100644 --- a/app/assets/stylesheets/desktop/topic.scss +++ b/app/assets/stylesheets/desktop/topic.scss @@ -11,13 +11,14 @@ } .post-actions { + @include unselectable; clear: both; text-align: right; - .post-action { + .post-action { display: inline-block; margin-left: 10px; margin-top: 10px; - } + } } .post-menu-area { margin-bottom: 10px; diff --git a/app/assets/stylesheets/desktop/user.scss b/app/assets/stylesheets/desktop/user.scss index 505f543edc6..fef462b893a 100644 --- a/app/assets/stylesheets/desktop/user.scss +++ b/app/assets/stylesheets/desktop/user.scss @@ -78,9 +78,7 @@ .btn { width: 100%; margin-bottom: 5px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + @include box-sizing(border-box); } } h2 { diff --git a/app/assets/stylesheets/mobile/compose.scss b/app/assets/stylesheets/mobile/compose.scss index f57a0ac0c3e..b8d2fb34af6 100644 --- a/app/assets/stylesheets/mobile/compose.scss +++ b/app/assets/stylesheets/mobile/compose.scss @@ -389,8 +389,7 @@ div.ac-wrap { } #wmd-input, #wmd-preview { - box-sizing: border-box; - -moz-box-sizing: border-box; + @include box-sizing(border-box); width: 100%; height: 100%; min-height: 100%; @@ -410,7 +409,7 @@ div.ac-wrap { top: 0; height: 100%; min-height: 100%; - box-sizing: border-box; + @include box-sizing(border-box); border: 0; border-top: 36px solid transparent; @include border-radius-all(0); @@ -418,8 +417,7 @@ div.ac-wrap { } .textarea-wrapper, .preview-wrapper { position: relative; - box-sizing: border-box; - -moz-box-sizing: border-box; + @include box-sizing(border-box); height: 100%; min-height: 100%; margin: 0; diff --git a/app/assets/stylesheets/mobile/magnific-popup.scss b/app/assets/stylesheets/mobile/magnific-popup.scss index 872ae8f2b7b..1c6cdb13a9a 100644 --- a/app/assets/stylesheets/mobile/magnific-popup.scss +++ b/app/assets/stylesheets/mobile/magnific-popup.scss @@ -147,9 +147,7 @@ $caption-subtitle-color: #BDBDBD !default; left: 0; top: 0; padding: 0 $popup-padding-left; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + @include box-sizing(border-box); } // Vertical centerer helper @@ -453,9 +451,7 @@ button::-moz-focus-inner { height: auto; display: block; line-height: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + @include box-sizing(border-box); padding: $image-padding-top 0 $image-padding-bottom; margin: 0 auto; } @@ -534,9 +530,7 @@ button::-moz-focus-inner { top: auto; padding: 3px 5px; position: fixed; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + @include box-sizing(border-box); } .mfp-img-mobile .mfp-bottom-bar:empty { padding: 0; diff --git a/app/assets/stylesheets/mobile/user.scss b/app/assets/stylesheets/mobile/user.scss index 4ac9aeb6429..bfdd68e2689 100644 --- a/app/assets/stylesheets/mobile/user.scss +++ b/app/assets/stylesheets/mobile/user.scss @@ -73,9 +73,7 @@ .btn { width: 100%; margin-bottom: 5px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + @include box-sizing(border-box); } } h2 {