From 7009c4e5d87d6a94875361202b55a7e97cccd485 Mon Sep 17 00:00:00 2001 From: Elad Bezalel Date: Thu, 24 Sep 2015 17:10:08 +0300 Subject: [PATCH] update(switch): fixed switch movement speed Closes #4581. Closes #4816. --- src/components/switch/demoBasicUsage/index.html | 2 +- src/components/switch/demoBasicUsage/script.js | 4 +++- src/components/switch/switch.scss | 2 +- src/core/style/variables.scss | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/switch/demoBasicUsage/index.html b/src/components/switch/demoBasicUsage/index.html index 74d83c2f0f8..30c02114485 100644 --- a/src/components/switch/demoBasicUsage/index.html +++ b/src/components/switch/demoBasicUsage/index.html @@ -20,6 +20,6 @@ - Switch 6 message: {{ message }} + Switch (onChange) state: {{ message }} diff --git a/src/components/switch/demoBasicUsage/script.js b/src/components/switch/demoBasicUsage/script.js index 1ddae820000..7991f6422de 100644 --- a/src/components/switch/demoBasicUsage/script.js +++ b/src/components/switch/demoBasicUsage/script.js @@ -6,7 +6,9 @@ angular.module('switchDemo1', ['ngMaterial']) cb5: false }; + $scope.message = 'false'; + $scope.onChange = function(cbState) { - $scope.message = "The switch is now: " + cbState; + $scope.message = cbState; }; }); diff --git a/src/components/switch/switch.scss b/src/components/switch/switch.scss index 1476050013b..512e7470992 100644 --- a/src/components/switch/switch.scss +++ b/src/components/switch/switch.scss @@ -114,7 +114,7 @@ md-switch { .md-bar, .md-thumb-container, .md-thumb { - transition: $swift-ease-in-out; + transition: $swift-linear; transition-property: transform, background-color; } .md-bar, diff --git a/src/core/style/variables.scss b/src/core/style/variables.scss index 78d6361b95d..2946b24e555 100644 --- a/src/core/style/variables.scss +++ b/src/core/style/variables.scss @@ -99,6 +99,10 @@ $swift-ease-in-out-duration: 0.5s !default; $swift-ease-in-out-timing-function: cubic-bezier(0.35, 0, 0.25, 1) !default; $swift-ease-in-out: all $swift-ease-in-out-duration $swift-ease-in-out-timing-function !default; +$swift-linear-duration: 0.08s !default; +$swift-linear-timing-function: linear !default; +$swift-linear: all $swift-linear-duration $swift-linear-timing-function !default; + // Fab Buttons (shared between buttons.scss and fab*.scss) // ------------------------------------------- $button-fab-width: rem(5.600) !default;