Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
f123a91a
Commit
f123a91a
authored
Dec 22, 2015
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor duplicated function call
parent
fdbd4277
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
annotation.js
h/static/scripts/directive/annotation.js
+9
-5
No files found.
h/static/scripts/directive/annotation.js
View file @
f123a91a
...
...
@@ -349,7 +349,7 @@ function AnnotationController(
// log in.
saveNewHighlight
();
updateView
Model
(
$scope
,
time
,
domainModel
,
vm
,
permissions
);
updateView
(
domainModel
);
// If this annotation is not a highlight and if it's new (has just been
// created by the annotate button) or it has edits not yet saved to the
...
...
@@ -361,9 +361,13 @@ function AnnotationController(
}
}
function
updateView
(
domainModel
)
{
updateViewModel
(
$scope
,
time
,
domainModel
,
vm
,
permissions
);
}
function
onAnnotationUpdated
(
event
,
updatedDomainModel
)
{
if
(
updatedDomainModel
.
id
===
domainModel
.
id
)
{
updateView
Model
(
$scope
,
time
,
updatedDomainModel
,
vm
,
permissions
);
updateView
(
updatedDomainModel
);
}
}
...
...
@@ -417,7 +421,7 @@ function AnnotationController(
domainModel
.
permissions
=
permissions
.
private
();
domainModel
.
$create
().
then
(
function
()
{
$rootScope
.
$emit
(
'annotationCreated'
,
domainModel
);
updateView
Model
(
$scope
,
time
,
domainModel
,
vm
,
permissions
);
updateView
(
domainModel
);
});
}
else
{
// User isn't logged in, save to drafts.
...
...
@@ -617,7 +621,7 @@ function AnnotationController(
if
(
vm
.
action
===
'create'
)
{
$rootScope
.
$emit
(
'annotationDeleted'
,
domainModel
);
}
else
{
updateView
Model
(
$scope
,
time
,
domainModel
,
vm
,
permissions
);
updateView
(
domainModel
);
view
();
}
};
...
...
@@ -649,7 +653,7 @@ function AnnotationController(
var
onFulfilled
=
function
()
{
$rootScope
.
$emit
(
'annotationCreated'
,
domainModel
);
updateView
Model
(
$scope
,
time
,
domainModel
,
vm
,
permissions
);
updateView
(
domainModel
);
view
();
drafts
.
remove
(
domainModel
);
};
...
...
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