Skip to content

Commit

Permalink
Added docs and fix linting issues
Browse files Browse the repository at this point in the history
Enact-DCO-1.0-Signed-off-by: Blake Stephens <[email protected]>
  • Loading branch information
Blake Stephens committed Feb 20, 2020
1 parent 8fc2eaa commit e2f0e9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
15 changes: 15 additions & 0 deletions packages/ui/Marquee/MarqueeController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {forward} from '@enact/core/handle';
import hoc from '@enact/core/hoc';
import {Job} from '@enact/core/util';
import PropTypes from 'prop-types';
import React from 'react';

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

static propTypes = /** @lends ui/Marquee.MarqueeController.prototype */ {
/**
* Determines what triggers the marquee to start its animation.
*
* This property is passed down to any chirdren Marquee components, and is used there,
* unless `marqueeOn` is specified for them as well.
*
* @type {('focus'|'hover'|'render')}
* @default 'focus'
* @public
*/
marqueeOn: PropTypes.oneOf(['focus', 'hover', 'render'])
}

constructor (props) {
super(props);

Expand Down
7 changes: 2 additions & 5 deletions packages/ui/Marquee/MarqueeDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,14 @@ const MarqueeDecorator = hoc(defaultConfig, (config, Wrapped) => {

static defaultProps = {
marqueeDelay: 1000,
// marqueeOn: 'focus',
marqueeOnRenderDelay: 1000,
marqueeResetDelay: 1000,
marqueeSpacing: '50%',
marqueeSpeed: 60
}

static contextType = MarqueeControllerContext

constructor (props) {
super(props);
this.state = {
Expand Down Expand Up @@ -405,8 +406,6 @@ const MarqueeDecorator = hoc(defaultConfig, (config, Wrapped) => {
off('keydown', this.handlePointerHide);
}

static contextType = MarqueeControllerContext

promoteJob = new Job(() => {
this.setState(state => state.promoted ? null : {promoted: true});
})
Expand Down Expand Up @@ -812,8 +811,6 @@ const MarqueeDecorator = hoc(defaultConfig, (config, Wrapped) => {
...rest
} = this.props;

console.log('marqueeOn:', marqueeOn, this.context && this.context.marqueeOn, children);

const marqueeOnFocus = marqueeOn === 'focus';
const marqueeOnHover = marqueeOn === 'hover';
const marqueeOnRender = marqueeOn === 'render';
Expand Down

0 comments on commit e2f0e9b

Please sign in to comment.