* Sets how elements should be scrolled into view for interaction. * @param {number} behavior The desired scroll behavior: either 0 to align with * the top of the viewport or 1 to align with the bottom. * @return {!Options} A self reference.
(behavior)
| 367 | * @return {!Options} A self reference. |
| 368 | */ |
| 369 | setScrollBehavior(behavior) { |
| 370 | if (behavior && behavior !== SCROLL_BEHAVIOUR.TOP && behavior !== SCROLL_BEHAVIOUR.BOTTOM) { |
| 371 | throw new error.InvalidArgumentError(`Element Scroll Behavior out of range. |
| 372 | It should be either ${SCROLL_BEHAVIOUR.TOP} or ${SCROLL_BEHAVIOUR.BOTTOM}`) |
| 373 | } |
| 374 | this.options_[Key.ELEMENT_SCROLL_BEHAVIOR] = behavior |
| 375 | return this |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | function createServiceFromCapabilities(capabilities) { |