]> source.dussan.org Git - vaadin-framework.git/commitdiff
Prevent user text selection by default (Valo)
authorJouni Koivuviita <jouni@vaadin.com>
Tue, 19 Aug 2014 17:07:04 +0000 (20:07 +0300)
committerArtur Signell <artur@vaadin.com>
Wed, 20 Aug 2014 14:20:33 +0000 (14:20 +0000)
Re-enable for labels, captions, tables and text inputs.

Removed all unnecessary user-select: none; declarations since the top
level declaration will affect the whole dom tree.

Change-Id: I2e74b749340c8649d3b0778d62acafecf878685d

12 files changed:
WebContent/VAADIN/themes/valo/components/_accordion.scss
WebContent/VAADIN/themes/valo/components/_datefield.scss
WebContent/VAADIN/themes/valo/components/_dragwrapper.scss
WebContent/VAADIN/themes/valo/components/_label.scss
WebContent/VAADIN/themes/valo/components/_table.scss
WebContent/VAADIN/themes/valo/components/_tabsheet.scss
WebContent/VAADIN/themes/valo/components/_textfield.scss
WebContent/VAADIN/themes/valo/components/_tree.scss
WebContent/VAADIN/themes/valo/components/_window.scss
WebContent/VAADIN/themes/valo/fonts/_fonts.scss
WebContent/VAADIN/themes/valo/shared/_global.scss
WebContent/VAADIN/themes/valo/util/_util.scss

index 82a43968282c9ea3708a3db804d2f6e5f8b2034a..e5457a233117737ed4caca0415517a99d7f24e7e 100644 (file)
@@ -85,7 +85,6 @@
     }
     border-bottom-color: first-color(valo-border($color: $v-panel-background-color));
     cursor: pointer;
-    @include user-select(none);;
 
     &:hover:before,
     &:active:before {
index 521d661a3d79a80563eeb748084fa0bfbea956b2..81c7fa0e5e288f9730f4bd6f3f7a929e4c9d7e79 100644 (file)
 @mixin valo-datefield-popup-style {
   @include valo-overlay-style;
 
-  @include user-select(none);
-
-   margin-top: ceil($v-unit-size/8) !important;
-   cursor: default;
+  margin-top: ceil($v-unit-size/8) !important;
+  cursor: default;
   width: auto;
 
    table {
index 6527e42ed7bd70151a5276504b766f64c1296b22..1eaf078661885e7a84f83b72214c44d6c64a66c5 100644 (file)
@@ -3,7 +3,6 @@
   [draggable=true] {
     -khtml-user-drag: element;
     -webkit-user-drag: element;
-    @include user-select(none);
   }
 
   .#{$primary-stylename}.v-active-drag-source {
index e61aa4ec11a8ab0845b8e4784e983114acb448f2..655ef6e1cc1fcfbda7c1962ba773c415d7867d73 100644 (file)
@@ -21,6 +21,10 @@ $v-letter-spacing--h4:    0               !default;
 
 @mixin valo-label ($primary-stylename: v-label, $include-additional-styles: contains($v-included-additional-styles, label)) {
 
+  .#{$primary-stylename} {
+    @include user-select(text);
+  }
+
   .#{$primary-stylename}-undef-w {
     white-space: nowrap;
   }
index adac1b90bd92aee85895084cf987ee3b694314d9..36e0565c83ca734c73eca5e90a41d19567903b83 100644 (file)
@@ -199,6 +199,7 @@ $v-table-background-color: null !default;
 
   .#{$primary-stylename}-body {
     border: $v-table-border-width solid $border-color;
+    @include user-select(text);
   }
 
   .#{$primary-stylename}-table {
index 7f2421b5ffa3e322d2d65ccaf38450a80da1778b..ccd70c4328d6a39ae57afb6b3e4fb049c2b3a140 100644 (file)
@@ -161,7 +161,6 @@ $v-tabsheet-content-animation-enabled: $v-animations-enabled !default;
 
 @mixin valo-tabsheet-tabcontainer-style ($primary-stylename: v-tabsheet) {
   position: relative;
-  @include user-select(none);
   @include box-sizing(border-box);
 
   &:before {
index 85e2487bc128bf3561084bdbfa2a52115b0da9e0..f0b0ec2532553bd1fef839d034451c49ed1244d7 100644 (file)
@@ -95,6 +95,7 @@ $v-textfield-disabled-opacity: $v-disabled-opacity !default;
 
   @if contains($states, normal) {
     @include appearance(none);
+    @include user-select(text);
     margin: 0;
     font: inherit;
     font-size: $font-size;
index 8e75f59945bff5acd629271dc1bd30bb271beed6..3cf4aed76039f168330d95124f911fb04d2ba199 100644 (file)
@@ -29,7 +29,6 @@ $v-tree-expand-animation-enabled: false !default;
   .#{$primary-stylename} {
     position: relative;
     white-space: nowrap;
-    @include user-select(none);
 
     &:focus {
       outline: none;
index b958be79daf3af793b0b24a984944432f8cd2bb0..cdd2298499e192bad94ea72ccb6c8d06b172db42 100644 (file)
@@ -102,7 +102,6 @@ $v-window-modality-curtain-background-color: #222 !default;
   }
 
   .#{$primary-stylename}-header {
-    @include user-select(none);
     cursor: move;
     line-height: $v-unit-size - 1px;
     padding-left: round($v-unit-size/3);
index b33e14d5d28061c7221c09441a99247333becf49..8f0a129335574b4ae4c2e00b68eb6f364fd3f55e 100644 (file)
@@ -29,7 +29,6 @@ $fontawesome-pathPrefix: null;
       -moz-osx-font-smoothing: grayscale;
       display: inline-block;
       text-align: center;
-      @include user-select(none);
   }
 }
 
index 7b7e63489a3077cb0eb7693cbc87625cf4ca1c24..5c010c128d5bc1d057e8c9467a8d8e51136431d9 100644 (file)
@@ -35,6 +35,24 @@ $valo-global-included: false !default;
       -webkit-text-size-adjust: 100%;
       -ms-text-size-adjust: 100%;
       -webkit-text-size-adjust: 100%;
+
+      // Disable text selection by default
+      @include user-select(none);
+
+      // Enable text selection for certain elements
+      input[type="text"],
+      .v-slot > .v-caption,
+      .v-gridlayout-slot > .v-caption,
+      .v-has-caption > .v-caption,
+      .v-formlayout-captioncell > .v-caption,
+      .v-csslayout > .v-caption {
+        @include user-select(text);
+      }
+
+      // Removes clear button from input fields introduced by IE10
+      input::-ms-clear {
+        display: none;
+      }
     }
 
     .v-ui {
@@ -56,11 +74,6 @@ $valo-global-included: false !default;
       height: 0;
     }
 
-    // Removes clear button from input fields introduced by IE10
-    input::-ms-clear {
-      display: none;
-    }
-
     .v-drag-element {
       z-index: 60000;
       // Override any other position properties
@@ -105,6 +118,7 @@ $valo-global-included: false !default;
 
     .v-icon {
       cursor: inherit;
+      @include user-select(none);
     }
 
     .v-icon,
index a510695560870b06bc72c144a9adcfc0eb5e88f4..1f983c0dad2332b4b8b9fc2c8a2a72f7051288c7 100644 (file)
@@ -20,7 +20,6 @@
 
 
 @mixin valo-tappable {
-  @include user-select(none);
   -webkit-tap-highlight-color: rgba(0,0,0,0);
   -webkit-touch-callout: none;
   cursor: pointer;