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
bdff3874
Commit
bdff3874
authored
Dec 09, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename private -> isPrivate
parent
18833085
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
annotation.js
h/static/scripts/directive/annotation.js
+1
-1
drafts.js
h/static/scripts/drafts.js
+6
-6
drafts-test.js
h/static/scripts/test/drafts-test.js
+1
-1
No files found.
h/static/scripts/directive/annotation.js
View file @
bdff3874
...
...
@@ -111,7 +111,7 @@ function isNew(domainModel) {
function
restoreFromDrafts
(
drafts
,
permissions
,
domainModel
,
vm
)
{
var
draft
=
drafts
.
get
(
domainModel
);
if
(
draft
)
{
if
(
draft
.
p
rivate
)
{
if
(
draft
.
isP
rivate
)
{
domainModel
.
permissions
=
permissions
.
private
();
}
else
{
domainModel
.
permissions
=
permissions
.
shared
(
domainModel
.
group
);
...
...
h/static/scripts/drafts.js
View file @
bdff3874
...
...
@@ -9,9 +9,9 @@
* the drafts service, they're only used to identify the correct draft to
* return.
*
* 2. `
private` (boolean), `tags` (array of strings) and `text` (string) which
*
are the user's draft changes to the annotation. These are returned from
* the drafts service by `drafts.get()`.
* 2. `
isPrivate` (boolean), `tags` (array of strings) and `text` (string)
*
which are the user's draft changes to the annotation. These are returned
*
from
the drafts service by `drafts.get()`.
*
*/
function
DraftStore
()
{
...
...
@@ -51,7 +51,7 @@ function DraftStore() {
for
(
var
i
=
0
;
i
<
this
.
_drafts
.
length
;
i
++
)
{
if
(
match
(
this
.
_drafts
[
i
],
model
))
{
return
{
private
:
this
.
_drafts
[
i
].
p
rivate
,
isPrivate
:
this
.
_drafts
[
i
].
isP
rivate
,
tags
:
this
.
_drafts
[
i
].
tags
,
text
:
this
.
_drafts
[
i
].
text
};
...
...
@@ -63,10 +63,10 @@ function DraftStore() {
* Update the draft version for a given annotation, replacing any
* existing draft.
*/
this
.
update
=
function
update
(
model
,
p
rivate
,
tags
,
text
)
{
this
.
update
=
function
update
(
model
,
isP
rivate
,
tags
,
text
)
{
var
newDraft
=
{
model
:
model
,
private
:
p
rivate
,
isPrivate
:
isP
rivate
,
tags
:
tags
,
text
:
text
};
...
...
h/static/scripts/test/drafts-test.js
View file @
bdff3874
...
...
@@ -14,7 +14,7 @@ describe('drafts', function () {
drafts
.
update
(
model
,
true
,
[
'foo'
],
'edit'
);
assert
.
deepEqual
(
drafts
.
get
(
model
),
{
p
rivate
:
true
,
tags
:
[
'foo'
],
text
:
'edit'
});
{
isP
rivate
:
true
,
tags
:
[
'foo'
],
text
:
'edit'
});
});
it
(
'should replace existing drafts'
,
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