mirror of
https://github.com/ExactTarget/fuelux.git
synced 2026-01-14 00:48:09 -05:00
38 lines
759 B
JavaScript
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;
|
|
})); |