Files
fuelux/2.6/sample/datasourceTree.js
2014-08-13 15:41:39 -04:00

38 lines
759 B
JavaScript

/*
* Fuel UX Data components - static data source
* https://github.com/ExactTarget/fuelux-data
*
* Copyright (c) 2012 ExactTarget
* Licensed under the MIT license.
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore'], factory);
} else {
root.TreeDataSource = factory();
}
}(this, function () {
var DataSourceTree = function (options) {
this._data = options.data;
this._delay = options.delay;
};
DataSourceTree.prototype = {
data: function (options, callback) {
var self = this;
setTimeout(function () {
var data = $.extend(true, [], self._data);
callback({ data: data });
}, this._delay)
}
};
return DataSourceTree;
}));