FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
roadmap/app/javascript/src/orgs/adminEdit.js at api-patch · DMPRoadmap/roadmap · GitHub
DMPRoadmap
roadmap
Repository navigation
Code
Issues
300
(300)
Pull requests
49
(49)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
roadmap
/
app
/
javascript
/
src
/
orgs
/
adminEdit.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
62 lines (54 loc) · 1.99 KB
Breadcrumbs
roadmap
/
app
/
javascript
/
src
/
orgs
/
adminEdit.js
Copy path
File metadata and controls
62 lines (54 loc) · 1.99 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// TODO: we need to be able to swap in the appropriate locale here
import
'number-to-text/converters/en-us'
;
import
{
isObject
}
from
'../utils/isType'
;
import
{
Tinymce
}
from
'../utils/tinymce.js'
;
import
{
eachLinks
}
from
'../utils/links'
;
import
{
initAutocomplete
,
scrubOrgSelectionParamsOnSubmit
}
from
'../utils/autoComplete'
;
$
(
(
)
=>
{
const
toggleFeedback
=
(
)
=>
{
const
editor
=
Tinymce
.
findEditorById
(
'org_feedback_msg'
)
;
if
(
isObject
(
editor
)
)
{
if
(
$
(
'#org_feedback_enabled_true'
)
.
is
(
':checked'
)
)
{
editor
.
mode
.
set
(
'design'
)
;
}
else
{
editor
.
mode
.
set
(
'readonly'
)
;
}
}
}
;
$
(
'#edit_org_feedback_form input[type="radio"]'
)
.
click
(
(
)
=>
{
toggleFeedback
(
)
;
}
)
;
// Initialises tinymce for any target element with class tinymce_answer
Tinymce
.
init
(
{
selector
:
'#org_feedback_msg'
}
)
;
toggleFeedback
(
)
;
if
(
$
(
'#org-details-org-controls'
)
.
length
>
0
)
{
initAutocomplete
(
'#org-details-org-controls .autocomplete'
)
;
// Scrub out the large arrays of data used for the Org Selector JS so that they
// are not a part of the form submissiomn
scrubOrgSelectionParamsOnSubmit
(
'#edit_org_profile_form'
)
;
}
// update the hidden org_type field based on the checkboxes selected
const
calculateOrgType
=
(
)
=>
{
let
orgType
=
0
;
$
(
'input.org_types:checked'
)
.
each
(
(
i
,
el
)
=>
{
orgType
+=
parseInt
(
$
(
el
)
.
val
(
)
,
10
)
;
}
)
;
$
(
'#org_org_type'
)
.
val
(
(
orgType
===
0
?
''
:
orgType
.
toString
(
)
)
)
;
}
;
$
(
'input.org_types'
)
.
on
(
'click'
,
calculateOrgType
)
;
$
(
'#edit_org_profile_form'
)
.
on
(
'submit'
,
(
)
=>
{
// Collect links
const
links
=
{
}
;
eachLinks
(
(
ctx
,
value
)
=>
{
links
[
ctx
]
=
value
;
}
)
.
done
(
(
)
=>
{
$
(
'#org_links'
)
.
val
(
JSON
.
stringify
(
links
)
)
;
}
)
;
}
)
;
$
(
'.links [data-toggle="tooltip"]'
)
.
on
(
'click'
,
(
e
)
=>
{
e
.
preventDefault
(
)
;
$
(
e
.
target
)
.
parent
(
'a'
)
.
tooltip
(
'toggle'
)
;
}
)
;
initAutocomplete
(
'#org-merge-controls .autocomplete'
)
;
scrubOrgSelectionParamsOnSubmit
(
'form.edit_org'
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL