Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
9ee8b0a6
Commit
9ee8b0a6
authored
Jan 31, 2019
by
bbaer
Browse files
relay comment.edited changes to CodeCorrection for save
parent
0683d55e
Pipeline
#1461
failed with stage
in 1 minute and 16 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/CodeCorrection.js
View file @
9ee8b0a6
...
...
@@ -240,6 +240,9 @@ var QfqNS = QfqNS || {};
console
.
log
(
"
With data:
"
+
argument
.
data
);
that
.
_handleNew
(
argument
.
data
);
});
commentCOntroller
.
on
(
'
comment.edited
'
,
function
()
{
this
.
_updateJSON
();
});
};
n
.
CodeCorrection
.
prototype
.
_handleNew
=
function
(
eventData
)
{
...
...
javascript/src/Comment.js
View file @
9ee8b0a6
...
...
@@ -35,8 +35,11 @@ var QfqNS = QfqNS || {};
this
.
options
=
options
;
}
this
.
childrenController
=
{};
this
.
eventEmitter
=
new
EventEmitter
();
};
n
.
Comment
.
prototype
.
on
=
n
.
EventEmitter
.
onMixin
;
n
.
Comment
.
prototype
.
display
=
function
()
{
var
displayElement
;
displayElement
=
this
.
_buildComment
();
...
...
@@ -144,7 +147,8 @@ var QfqNS = QfqNS || {};
this
.
comment
.
comment
=
e
.
data
.
text
;
this
.
_updateText
(
e
.
data
.
text
);
this
.
$comment
.
show
();
e
.
data
.
$container
.
destroy
();
e
.
data
.
$container
.
remove
();
this
.
emitEvent
(
'
comment.edited
'
,
n
.
EventEmitter
.
makePayload
(
this
,
this
.
comment
));
};
})(
QfqNS
);
\ No newline at end of file
javascript/src/CommentController.js
View file @
9ee8b0a6
...
...
@@ -103,10 +103,18 @@ var QfqNS = QfqNS || {};
commentObject
.
display
();
this
.
comments
.
push
(
commentObject
);
this
.
_changeHandler
(
"
new
"
,
commentObject
);
this
.
comment
.
on
(
'
comment.edited
'
)
this
.
updateHeight
();
return
this
.
comments
.
length
-
1
;
};
n
.
CommetController
.
prototype
.
_setCommentListeners
=
function
(
commentObject
)
{
var
that
=
this
;
commentObject
.
on
(
'
comment.edited
'
,
function
(
e
)
{
that
.
updateComment
(
e
.
data
);
});
};
n
.
CommentController
.
prototype
.
displayComments
=
function
()
{
for
(
var
i
=
0
;
this
.
comments
;
i
++
)
{
this
.
comments
[
i
].
display
();
...
...
@@ -146,8 +154,10 @@ var QfqNS = QfqNS || {};
};
n
.
CommentController
.
prototype
.
updateComment
=
function
(
reference
,
data
)
{
n
.
CommentController
.
prototype
.
updateComment
=
function
(
data
)
{
console
.
log
(
"
[Comment Changed] User:
"
+
data
.
uid
+
"
Text:
"
+
data
.
comment
.
substring
(
0
,
20
)
+
"
...
"
);
this
.
emitEvent
(
"
edit
"
);
};
n
.
CommentController
.
prototype
.
updateHeight
=
function
()
{
...
...
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