Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
0ab07dc2
Commit
0ab07dc2
authored
Mar 27, 2013
by
Marcel
Browse files
Add loadContent to helpers.
parent
8cfe0091
Changes
1
Hide whitespace changes
Inline
Side-by-side
vispa/static/js/base/helpers.js
View file @
0ab07dc2
...
...
@@ -84,6 +84,25 @@ $.Helpers = {
return
path
;
},
loadContent
:
function
(
url
,
requestData
)
{
requestData
=
$
.
extend
({
url
:
url
,
type
:
"
GET
"
,
async
:
false
,
data
:
{},
contentKey
:
null
},
requestData
);
var
promise
=
$
.
ajax
(
requestData
);
if
(
requestData
.
async
)
{
return
promise
;
}
var
content
;
$
.
when
(
promise
).
then
(
function
(
response
)
{
content
=
requestData
.
contentKey
?
response
[
requestData
.
contentKey
]
:
response
;
});
return
content
;
},
hasTouch
:
function
()
{
return
$
.
support
.
touch
;
},
...
...
Write
Preview
Supports
Markdown
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