Commit 0ab07dc2 authored by Marcel's avatar Marcel
Browse files

Add loadContent to helpers.

parent 8cfe0091
......@@ -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;
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment