Skip to content

Commit

Permalink
Merge pull request #712 from blueo/pulls/add-injector-to-gallery-toolbar
Browse files Browse the repository at this point in the history
Enhancement: add injector to gallery toolbar
  • Loading branch information
flamerohr authored Jan 18, 2018
2 parents ae1ed3c + 86b1188 commit 8d98c03
Show file tree
Hide file tree
Showing 17 changed files with 624 additions and 297 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_ssembed.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-file.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_ssmedia.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/src/boot/registerComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import UploadField from 'components/UploadField/UploadField';
import PreviewImageField from 'components/PreviewImageField/PreviewImageField';
import ProportionConstraintField from 'components/ProportionConstraintField/ProportionConstraintField';
import HistoryList from 'containers/HistoryList/HistoryList';
import GalleryToolbar from 'components/GalleryToolbar/GalleryToolbar';

const registerComponents = () => {
Injector.component.register('UploadField', UploadField);
Injector.component.register('PreviewImageField', PreviewImageField);
Injector.component.register('HistoryList', HistoryList);
Injector.component.register('ProportionConstraintField', ProportionConstraintField);
Injector.component.register('GalleryToolbar', GalleryToolbar);
};

export default registerComponents;
42 changes: 42 additions & 0 deletions client/src/components/GalleryToolbar/Buttons/AddFolderButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React, { Component, PropTypes } from 'react';
import i18n from 'i18n';

/**
* Gallery Toolbar add folder button.
*
* @returns {XML} button
*/
class AddFolderButton extends Component {
constructor() {
super();
this.handleCreateFolder = this.handleCreateFolder.bind(this);
}
handleCreateFolder(event) {
const { onCreateFolder } = this.props;
event.preventDefault();
if (typeof onCreateFolder === 'function') {
onCreateFolder();
}
}
render() {
const { canEdit } = this.props;
return (
<button
id="add-folder-button"
className="btn btn-secondary font-icon-folder-add btn--icon-xl"
type="button"
onClick={this.handleCreateFolder}
disabled={!canEdit}
>
<span className="btn__text btn__title">{i18n._t('AssetAdmin.ADD_FOLDER_BUTTON')}</span>
</button>
);
}
}

AddFolderButton.propTypes = {
canEdit: PropTypes.bool.isRequired,
onCreateFolder: PropTypes.func.isRequired,
};

export default AddFolderButton;
Loading

0 comments on commit 8d98c03

Please sign in to comment.