gd-sprest 8.0.6 → 8.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/helper/methods/loadSPCore.js +14 -7
- package/build/rest.js +1 -1
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
|
@@ -9,23 +9,30 @@ exports.loadSPCore = function () {
|
|
|
9
9
|
return new Promise(function (resolve) {
|
|
10
10
|
// Define the core libraries to load
|
|
11
11
|
var libs = ["init", "MicrosoftAjax", "SP.Runtime", "SP"];
|
|
12
|
-
|
|
13
|
-
for (var i = 0; i < libs.length; i++) {
|
|
12
|
+
var _loop_1 = function (i) {
|
|
14
13
|
var libName = libs[i];
|
|
15
14
|
// See if a script already exists
|
|
16
15
|
if (document.querySelector("script[title='" + libName + "']") == null) {
|
|
17
16
|
// Log
|
|
18
17
|
console.debug("[gd-sprest] Loading the core library: " + libName);
|
|
19
|
-
//
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
// Create the script element to load the library
|
|
19
|
+
var elScript_1 = document.createElement("script");
|
|
20
|
+
elScript_1.title = libName;
|
|
21
|
+
elScript_1.src = document.location.origin + "/_layouts/15/" + libName + ".js";
|
|
22
|
+
// Wait for the previous library to load
|
|
23
|
+
setTimeout(function () {
|
|
24
|
+
// Load the script
|
|
25
|
+
document.head.appendChild(elScript_1);
|
|
26
|
+
}, 10 * i);
|
|
24
27
|
}
|
|
25
28
|
else {
|
|
26
29
|
// Log
|
|
27
30
|
console.debug("[gd-sprest] Core library already loaded: " + libName);
|
|
28
31
|
}
|
|
32
|
+
};
|
|
33
|
+
// Parse the libraries
|
|
34
|
+
for (var i = 0; i < libs.length; i++) {
|
|
35
|
+
_loop_1(i);
|
|
29
36
|
}
|
|
30
37
|
// Resolve the request
|
|
31
38
|
resolve();
|
package/build/rest.js
CHANGED