-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename components to have *.jsx extension
This is a preliminary step to the actual conversion to JSX.
- Loading branch information
Showing
24 changed files
with
70 additions
and
36 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import m from 'mithril'; | ||
import classNames from '../classnames.js'; | ||
import PanelComponent from './panel.jsx'; | ||
|
||
class ControlComponent { | ||
|
||
view({attrs: {id, title, icon = null, label = null, action = null, panel = null, panelPosition = 'top'}}) { | ||
return m(`div.control.control-${id}`, { | ||
class: classNames({'control-has-label': label}) | ||
}, [ | ||
panel ? m(PanelComponent, {id, position: panelPosition}, panel) : null, | ||
m('button.control-button', { | ||
title, | ||
onclick: ({target}) => { | ||
if (panel) { | ||
PanelComponent.togglePanel(id); | ||
} else if (action) { | ||
// Do not close the panel where the clicked control resides | ||
if (!target.closest('.panel')) { | ||
PanelComponent.closeAllPanels(); | ||
} | ||
action(); | ||
} | ||
} | ||
}, [ | ||
icon ? m('img.control-icon', {src: `icons/${icon}.svg`, alt: title}) : null, | ||
label ? m('span.control-label', label) : null | ||
]) | ||
]); | ||
} | ||
|
||
} | ||
|
||
export default ControlComponent; |
2 changes: 1 addition & 1 deletion
2
scripts/components/drawing-area.js → scripts/components/drawing-area.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
scripts/components/export-gif.js → scripts/components/export-gif.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
scripts/components/settings.js → scripts/components/settings.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
scripts/components/storage-upgrader.js → scripts/components/storage-upgrader.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
scripts/components/story-controls.js → scripts/components/story-controls.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
scripts/components/story-editor.js → scripts/components/story-editor.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
scripts/components/story-header.js → scripts/components/story-header.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
scripts/components/story-list.js → scripts/components/story-list.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
scripts/components/timeline.js → scripts/components/timeline.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters