| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Implementation of a scrollbar for the custom scrolling behavior | 6 * Implementation of a scrollbar for the custom scrolling behavior |
| 7 * defined in [:Scroller:]. | 7 * defined in [:Scroller:]. |
| 8 */ | 8 */ |
| 9 class Scrollbar implements ScrollListener { | 9 class Scrollbar implements ScrollListener { |
| 10 /** | 10 /** |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 show = true; | 291 show = true; |
| 292 } | 292 } |
| 293 _toggleOpacity(_verticalElement, show); | 293 _toggleOpacity(_verticalElement, show); |
| 294 _toggleOpacity(_horizontalElement, show); | 294 _toggleOpacity(_horizontalElement, show); |
| 295 } | 295 } |
| 296 | 296 |
| 297 _toggleOpacity(Element element, bool show) { | 297 _toggleOpacity(Element element, bool show) { |
| 298 if (show) { | 298 if (show) { |
| 299 element.style.removeProperty("opacity"); | 299 element.style.removeProperty("opacity"); |
| 300 } else { | 300 } else { |
| 301 Css.setOpacity(element.style, '0'); | 301 element.style.opacity = '0'; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 num _defaultScrollSize(num frameSize, num contentSize) { | 305 num _defaultScrollSize(num frameSize, num contentSize) { |
| 306 return GoogleMath.clamp( | 306 return GoogleMath.clamp( |
| 307 (frameSize -_PADDING_LENGTH * 2) * frameSize / contentSize, | 307 (frameSize -_PADDING_LENGTH * 2) * frameSize / contentSize, |
| 308 _MIN_SIZE, frameSize -_PADDING_LENGTH * 2); | 308 _MIN_SIZE, frameSize -_PADDING_LENGTH * 2); |
| 309 } | 309 } |
| 310 | 310 |
| 311 /** | 311 /** |
| (...skipping 29 matching lines...) Expand all Loading... |
| 341 style.setProperty(cssPos, '${pos}px', ''); | 341 style.setProperty(cssPos, '${pos}px', ''); |
| 342 if (_cachedSize[cssSize] != size) { | 342 if (_cachedSize[cssSize] != size) { |
| 343 _cachedSize[cssSize] = size; | 343 _cachedSize[cssSize] = size; |
| 344 style.setProperty(cssSize, '${size}px', ''); | 344 style.setProperty(cssSize, '${size}px', ''); |
| 345 } | 345 } |
| 346 if (element.parent == null) { | 346 if (element.parent == null) { |
| 347 _frame.nodes.add(element); | 347 _frame.nodes.add(element); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 } | 350 } |
| OLD | NEW |