Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
508328e9
Commit
508328e9
authored
Mar 10, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: use renderjs mutex
parent
77089c03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js
...inTemplateItem/portal_skins/erp5_core/gadget_editor.js.js
+12
-20
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js
View file @
508328e9
/*jslint nomen: true, indent: 2 */
/*global window, rJS, RSVP, document, FileReader, Blob,
lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
(
function
(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
,
lockGadgetInQueue
,
unlockGadgetInQueue
,
unlockGadgetInFailedQueue
)
{
/*global window, rJS, RSVP, document, FileReader, Blob*/
(
function
(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
)
{
"
use strict
"
;
var
editor_dict
=
{
...
...
@@ -44,8 +42,12 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
}
});
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
return
this
.
renderAsynchronously
(
options
);
})
.
declareJob
(
'
renderAsynchronously
'
,
function
(
options
)
{
var
state_dict
=
{
value
:
options
.
value
||
""
,
editor
:
options
.
editor
,
...
...
@@ -62,16 +64,12 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
})
.
onStateChange
(
function
(
modification_dict
)
{
return
this
.
renderAsynchronously
(
modification_dict
);
})
.
declareJob
(
'
renderAsynchronously
'
,
function
(
modification_dict
)
{
var
element
=
this
.
element
,
gadget
=
this
,
url
,
div
=
document
.
createElement
(
'
div
'
),
div_max
=
document
.
createElement
(
'
div
'
),
queue
=
lockGadgetInQueue
(
gadget
)
();
queue
=
new
RSVP
.
Queue
();
if
((
modification_dict
.
hasOwnProperty
(
'
editable
'
))
||
(
modification_dict
.
hasOwnProperty
(
'
editor
'
))
||
...
...
@@ -179,8 +177,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
}
else
{
element
.
querySelector
(
'
pre
'
).
textContent
=
gadget
.
state
.
value
;
}
return
queue
.
push
(
unlockGadgetInQueue
(
gadget
),
unlockGadgetInFailedQueue
(
gadget
));
return
queue
;
})
.
declareMethod
(
'
getContent
'
,
function
()
{
...
...
@@ -189,14 +186,10 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
result
;
if
(
this
.
state
.
editable
&&
editor_dict
.
hasOwnProperty
(
gadget
.
state
.
editor
))
{
return
lockGadgetInQueue
(
gadget
)()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
editor
'
);
})
return
gadget
.
getDeclaredGadget
(
'
editor
'
)
.
push
(
function
(
editor_gadget
)
{
return
editor_gadget
.
getContent
.
apply
(
editor_gadget
,
argument_list
);
})
.
push
(
unlockGadgetInQueue
(
gadget
),
unlockGadgetInFailedQueue
(
gadget
));
});
/*
.push(function (result) {
var value = result[context.state.key] || '';
...
...
@@ -215,12 +208,11 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
return
result
;
}
return
{};
})
}
,
{
mutex
:
'
changestate
'
}
)
.
declareMethod
(
'
checkValidity
'
,
function
()
{
// XXX How to implement this for editors?
return
true
;
});
}(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
,
lockGadgetInQueue
,
unlockGadgetInQueue
,
unlockGadgetInFailedQueue
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
));
\ No newline at end of file
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