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

Fixed the editor class name in the production build #226

Merged
merged 1 commit into from
Sep 4, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default class Editor {

this.domManipulator.addAttribute( root, 'data-github-writer-id', this.id );

// Add a class for this editor contructor, for easy to customize specific editors.
this.domManipulator.addClass( root, 'github-writer-' + this.constructor.name.toLowerCase() );
// Add a class for this editor type, for easy to customize specific editors.
this.domManipulator.addClass( root, 'github-writer-' + String( this.type ).toLowerCase() );

// Inject our classes in the dom. These will help controlling the editor through CSS.
this.domManipulator.addClass( this.dom.panels.markdown, 'github-writer-panel-markdown' );
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/codeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default class CodeEditor extends Editor {
registerUpdateListener( this );
}

get type() {
return 'CodeEditor';
}

getDom( root ) {
const dom = super.getDom( root );

Expand Down
4 changes: 4 additions & 0 deletions src/app/features/codelinecommenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import Editor from '../editor/editor';
let listening = false;

export default class CodeLineCommentEditor extends Editor {
get type() {
return 'CodeLineCommentEditor';
}

static run() {
if ( !listening ) {
// Code line comments: the "+" button...fires an event when the form for code comments is injected.
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/commenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import Editor from '../editor/editor';
import { addClickListener } from '../modules/util';

export default class CommentEditor extends Editor {
get type() {
return 'CommentEditor';
}

injectEditable( editable ) {
const container = this.createEditableContainer( editable );

Expand Down
4 changes: 4 additions & 0 deletions src/app/features/milestoneeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export default class MilestoneEditor extends Editor {
root.classList.add( 'github-writer-type-milestone' );
}

get type() {
return 'MilestoneEditor';
}

getDom( root ) {
const dom = super.getDom( root );

Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newcodeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default class NewCodeEditor extends CodeEditor {
this._checkFileType();
}

get type() {
return 'NewCodeEditor';
}

_setInitialMode() {
super._setInitialMode( editorModes.MARKDOWN );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newcommenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class NewCommentEditor extends Editor {
get type() {
return 'NewCommentEditor';
}

getSizeContainer() {
return this.dom.root.querySelector( '.timeline-comment' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newinlinecommenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import Editor from '../editor/editor';
import { addClickListener } from '../modules/util';

export default class NewInlineCommentEditor extends Editor {
get type() {
return 'NewInlineCommentEditor';
}

getSizeContainer() {
return this.dom.root;
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newissueeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class NewIssueEditor extends Editor {
get type() {
return 'NewIssueEditor';
}

static run() {
return this.createEditor( 'form#new_issue' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newpullrequesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class NewPullRequestEditor extends Editor {
get type() {
return 'NewPullRequestEditor';
}

static run() {
return this.createEditor( 'form#new_pull_request' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/releaseeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class ReleaseEditor extends Editor {
get type() {
return 'ReleaseEditor';
}

getDom( root ) {
const dom = super.getDom( root );
delete dom.toolbar;
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/revieweditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class ReviewEditor extends Editor {
get type() {
return 'ReviewEditor';
}

static run() {
return this.createEditor( 'div.pull-request-review-menu > form' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/savedreplyeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class SavedReplyEditor extends Editor {
get type() {
return 'SavedReplyEditor';
}

static run() {
return this.createEditor( 'form.new_saved_reply, form.edit_saved_reply' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/wikieditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class WikiEditor extends Editor {
get type() {
return 'WikiEditor';
}

getDom( root ) {
const dom = super.getDom( root );

Expand Down