Skip to content

Commit 19f8a15

Browse files
author
Blake Stephens
committed
Added docs and fix linting issues
Enact-DCO-1.0-Signed-off-by: Blake Stephens <[email protected]>
1 parent 66bf9ab commit 19f8a15

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

packages/ui/Marquee/MarqueeController.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {forward} from '@enact/core/handle';
22
import hoc from '@enact/core/hoc';
33
import {Job} from '@enact/core/util';
4+
import PropTypes from 'prop-types';
45
import React from 'react';
56

67
const STATE = {
@@ -46,6 +47,20 @@ const MarqueeController = hoc(defaultConfig, (config, Wrapped) => {
4647
return class extends React.Component {
4748
static displayName = 'MarqueeController'
4849

50+
static propTypes = /** @lends ui/Marquee.MarqueeController.prototype */ {
51+
/**
52+
* Determines what triggers the marquee to start its animation.
53+
*
54+
* This property is passed down to any chirdren Marquee components, and is used there,
55+
* unless `marqueeOn` is specified for them as well.
56+
*
57+
* @type {('focus'|'hover'|'render')}
58+
* @default 'focus'
59+
* @public
60+
*/
61+
marqueeOn: PropTypes.oneOf(['focus', 'hover', 'render'])
62+
}
63+
4964
constructor (props) {
5065
super(props);
5166

packages/ui/Marquee/MarqueeDecorator.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,14 @@ const MarqueeDecorator = hoc(defaultConfig, (config, Wrapped) => {
308308

309309
static defaultProps = {
310310
marqueeDelay: 1000,
311-
// marqueeOn: 'focus',
312311
marqueeOnRenderDelay: 1000,
313312
marqueeResetDelay: 1000,
314313
marqueeSpacing: '50%',
315314
marqueeSpeed: 60
316315
}
317316

317+
static contextType = MarqueeControllerContext
318+
318319
constructor (props) {
319320
super(props);
320321
this.state = {
@@ -405,8 +406,6 @@ const MarqueeDecorator = hoc(defaultConfig, (config, Wrapped) => {
405406
off('keydown', this.handlePointerHide);
406407
}
407408

408-
static contextType = MarqueeControllerContext
409-
410409
promoteJob = new Job(() => {
411410
if (!this.contentFits) {
412411
this.setState(state => state.promoted ? null : {promoted: true});
@@ -836,8 +835,6 @@ const MarqueeDecorator = hoc(defaultConfig, (config, Wrapped) => {
836835
...rest
837836
} = this.props;
838837

839-
console.log('marqueeOn:', marqueeOn, this.context && this.context.marqueeOn, children);
840-
841838
const marqueeOnFocus = marqueeOn === 'focus';
842839
const marqueeOnHover = marqueeOn === 'hover';
843840
const marqueeOnRender = marqueeOn === 'render';

0 commit comments

Comments
 (0)