Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add missing minHeight attribute to Option interface #123

Merged
merged 2 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 37 additions & 29 deletions types/easymde-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const editor = new EasyMDE({
console.log('FullscreenToggled', full);
},
theme: 'someOtherTheme',
minHeight: '200px'
});

// Editor functions
Expand All @@ -35,29 +36,36 @@ EasyMDE.toggleItalic = (editor: EasyMDE) => {
const editor2 = new EasyMDE({
autoDownloadFontAwesome: undefined,
previewClass: ['my-custom-class', 'some-other-class'],
toolbar: [{
name: 'bold',
action: EasyMDE.toggleBold,
className: 'fa fa-bolt',
title: 'Bold',
}, '|', { // Separator
name: 'alert',
action: (editor: EasyMDE) => {
alert('This is from a custom button action!');
// Custom functions have access to the `editor` instance.
toolbar: [
{
name: 'bold',
action: EasyMDE.toggleBold,
className: 'fa fa-bolt',
title: 'Bold'
},
className: 'fa fa-star',
title: 'A Custom Button',
noDisable: undefined,
noMobile: false,
}, '|', {
name: 'link',
action: 'https://github.com/Ionaru/easy-markdown-editor',
className: 'fa fab fa-github',
title: 'A Custom Link',
noDisable: true,
noMobile: true,
}]
'|',
{
// Separator
name: 'alert',
action: (editor: EasyMDE) => {
alert('This is from a custom button action!');
// Custom functions have access to the `editor` instance.
},
className: 'fa fa-star',
title: 'A Custom Button',
noDisable: undefined,
noMobile: false
},
'|',
{
name: 'link',
action: 'https://github.com/Ionaru/easy-markdown-editor',
className: 'fa fab fa-github',
title: 'A Custom Link',
noDisable: true,
noMobile: true
}
]
});

editor2.clearAutosavedValue();
Expand All @@ -80,11 +88,11 @@ const editorImages = new EasyMDE({
noFileGiven: 'Please select a file',
typeNotAllowed: 'This file type is not allowed!',
fileTooLarge: 'Image too big',
importError: 'Something went oops!',
importError: 'Something went oops!'
},
errorCallback: (errorMessage) => {
errorCallback: errorMessage => {
console.error(errorMessage);
},
}
});

const editorImagesCustom = new EasyMDE({
Expand All @@ -109,9 +117,9 @@ const editorImagesCustom = new EasyMDE({
noFileGiven: 'Please select a file',
typeNotAllowed: 'This file type is not allowed!',
fileTooLarge: 'Image too big',
importError: 'Something went oops!',
importError: 'Something went oops!'
},
errorCallback: (errorMessage) => {
errorCallback: errorMessage => {
console.error(errorMessage);
},
});
}
});
1 change: 1 addition & 0 deletions types/easymde.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ declare namespace EasyMDE {
initialValue?: string;
insertTexts?: InsertTextOptions;
lineWrapping?: boolean;
minHeight?: string;
parsingConfig?: ParsingOptions;
placeholder?: string;
previewClass?: string | ReadonlyArray<string>;
Expand Down