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
af20774b
Commit
af20774b
authored
Dec 03, 2018
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update IDE index.js with 'extendStore'
parent
435a3d2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
app/assets/javascripts/ide/index.js
app/assets/javascripts/ide/index.js
+5
-5
No files found.
app/assets/javascripts/ide/index.js
View file @
af20774b
import
Vue
from
'
vue
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
_
from
'
underscore
'
;
import
Translate
from
'
~/vue_shared/translate
'
;
import
ide
from
'
./components/ide.vue
'
;
import
store
from
'
./stores
'
;
...
...
@@ -13,19 +14,19 @@ Vue.use(Translate);
*
* @param {Element} el - The element that will contain the IDE.
* @param {Object} options - Extra options for the IDE (Used by EE).
* @param {(e:Element) => Object} options.extraInitialData -
* Function that returns extra properties to seed initial data.
* @param {Component} options.rootComponent -
* Component that overrides the root component.
* @param {(store:Vuex.Store, el:Element) => Vuex.Store} options.extendStore -
* Function that receives the default store and returns an extended one.
*/
export
function
initIde
(
el
,
options
=
{})
{
if
(
!
el
)
return
null
;
const
{
extraInitialData
=
()
=>
({}),
rootComponent
=
ide
}
=
options
;
const
{
rootComponent
=
ide
,
extendStore
=
_
.
identity
}
=
options
;
return
new
Vue
({
el
,
store
,
store
:
extendStore
(
store
,
el
)
,
router
,
created
()
{
this
.
setEmptyStateSvgs
({
...
...
@@ -41,7 +42,6 @@ export function initIde(el, options = {}) {
});
this
.
setInitialData
({
clientsidePreviewEnabled
:
parseBoolean
(
el
.
dataset
.
clientsidePreviewEnabled
),
...
extraInitialData
(
el
),
});
},
methods
:
{
...
...
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