Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0512f59a
Commit
0512f59a
authored
Dec 02, 2021
by
Denys Mishunov
Committed by
Jacques Erasmus
Dec 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-order the arguments list to onSetup
parent
08f06466
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
app/assets/javascripts/editor/extensions/example_source_editor_extension.js
...ipts/editor/extensions/example_source_editor_extension.js
+2
-2
app/assets/javascripts/editor/source_editor_instance.js
app/assets/javascripts/editor/source_editor_instance.js
+1
-1
spec/frontend/editor/helpers.js
spec/frontend/editor/helpers.js
+1
-1
spec/frontend/editor/source_editor_instance_spec.js
spec/frontend/editor/source_editor_instance_spec.js
+1
-1
No files found.
app/assets/javascripts/editor/extensions/example_source_editor_extension.js
View file @
0512f59a
...
...
@@ -16,11 +16,11 @@ export class MyFancyExtension {
* actions, keystrokes, update options, etc.
* Is called only once before the extension gets registered
*
* @param { Object } [setupOptions] The setupOptions object
* @param { Object } [instance] The Source Editor instance
* @param { Object } [setupOptions] The setupOptions object
*/
// eslint-disable-next-line class-methods-use-this,no-unused-vars
onSetup
(
setupOptions
,
instance
)
{}
onSetup
(
instance
,
setupOptions
)
{}
/**
* The first thing called after the extension is
...
...
app/assets/javascripts/editor/source_editor_instance.js
View file @
0512f59a
...
...
@@ -153,7 +153,7 @@ export default class EditorInstance {
const
extensionInstance
=
new
EditorExtension
(
extension
);
const
{
setupOptions
,
obj
:
extensionObj
}
=
extensionInstance
;
if
(
extensionObj
.
onSetup
)
{
extensionObj
.
onSetup
(
setupOptions
,
thi
s
);
extensionObj
.
onSetup
(
this
,
setupOption
s
);
}
if
(
extensionsStore
)
{
this
.
registerExtension
(
extensionInstance
,
extensionsStore
);
...
...
spec/frontend/editor/helpers.js
View file @
0512f59a
...
...
@@ -31,7 +31,7 @@ export const SEConstExt = () => {
export
function
SEWithSetupExt
()
{
return
{
onSetup
:
(
setupOptions
=
{},
instance
)
=>
{
onSetup
:
(
instance
,
setupOptions
=
{}
)
=>
{
if
(
setupOptions
&&
!
Array
.
isArray
(
setupOptions
))
{
Object
.
entries
(
setupOptions
).
forEach
(([
key
,
value
])
=>
{
Object
.
assign
(
instance
,
{
...
...
spec/frontend/editor/source_editor_instance_spec.js
View file @
0512f59a
...
...
@@ -424,7 +424,7 @@ describe('Source Editor Instance', () => {
definition
:
MyFullExtWithCallbacks
,
setupOptions
:
defSetupOptions
,
});
expect
(
onSetup
).
toHaveBeenCalledWith
(
defSetupOptions
,
seInstance
);
expect
(
onSetup
).
toHaveBeenCalledWith
(
seInstance
,
defSetupOptions
);
expect
(
onUse
).
toHaveBeenCalledWith
(
seInstance
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment