-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdromos.bootstrap.text.js
More file actions
32 lines (31 loc) · 1.26 KB
/
dromos.bootstrap.text.js
File metadata and controls
32 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*====================================
Text plugin for dromos bootstrap.
This plugin will load any modules indicated as text content. The content of the file will be placed
inside a div tag and passed to the executing function as a parameter.
====================================*/
define(["jquery"],function($jQ){
return new (dromos.Bootstrap.Plugin.extend(
{
load : function(toModule)
{
// If the module is already loaded then there is nothing to do
if (!toModule.isLoading() && !toModule.isCompleted())
{
$jQ.ajax({
url : toModule.getURL(),
context : this,
success: function(toData, tcStatus, toXHR){
var loTag = document.createElement("div");
loTag.innerHTML = toData;
toModule.setTag(loTag);
toModule.setDefinition(loTag);
toModule.complete();
},
error: function(toXHR, tcStatus, toError){
this.onError(loModule);
}});
}
}
}
));
});