Commit 3e5c72e8 authored by Roisin Pearson's avatar Roisin Pearson Committed by Cecilia Vela Gurovic
Browse files

Bug #1742347 Added functionality for params



when using jTLine in ajax mode we can pass in a "params" object
containing variables e.g. sesskey

behatnotneeded

Change-Id: Id8c1ce149ec30b267aa8c98a2d16e6690bdac4fa
Signed-off-by: default avatarRoisin Pearson <roisinpearson@catalyst.net.nz>
parent 65337cd7
......@@ -10,3 +10,4 @@ Build upon the fantastic "codyhouse" article.
Changes:
* Removed demo examples
* Adjusted ajax setting to accept parameters from Mahara
......@@ -6,6 +6,7 @@
eventsMinDistance: 60,
callType: 'ajax',
url: '',
params: {},
structureObj: [{}],
distanceMode: 'auto', // predefinedDistance , fixDistance
fixDistanceValue: 2,
......@@ -353,13 +354,13 @@
var _fetchData = function (obj) {
// var dataResult;
if (options.callType == callTypes.ajax) {
$.getJSON(options.url, function (data) {
// console.log(data);
}).done(function (data) {
$.getJSON(options.url, options.params)
.done(function (data) {
//----------------------
if (data)
_constructDom(data, obj);
if (data.error==false) {
_constructDom(data.message.data, obj);
}
else {
$(obj).html("Error fetching data");
}
......
Markdown is supported
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