pict 1.0.58 → 1.0.60
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/package.json +1 -1
- package/source/Pict-Application.js +8 -2
- package/source/Pict-View.js +8 -2
- package/source/Pict.js +19 -1
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ const defaultPictSettings = (
|
|
|
18
18
|
|
|
19
19
|
class PictApplication extends libFableServiceBase
|
|
20
20
|
{
|
|
21
|
-
constructor(pFable, pOptions, pServiceHash)
|
|
21
|
+
constructor(pFable, pOptions, pServiceHash, fCallback)
|
|
22
22
|
{
|
|
23
23
|
super(pFable, pOptions, pServiceHash);
|
|
24
24
|
this.options = this.fable.Utility.extend(defaultPictSettings, this.options);
|
|
@@ -54,9 +54,15 @@ class PictApplication extends libFableServiceBase
|
|
|
54
54
|
if (pError)
|
|
55
55
|
{
|
|
56
56
|
this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} did not auto initialize/render properly: ${pError}`, pError);
|
|
57
|
+
}
|
|
58
|
+
if (typeof(fCallback) === 'function')
|
|
59
|
+
{
|
|
60
|
+
return fCallback(pError);
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
{
|
|
57
64
|
return false;
|
|
58
65
|
}
|
|
59
|
-
return true;
|
|
60
66
|
});
|
|
61
67
|
}
|
|
62
68
|
|
package/source/Pict-View.js
CHANGED
|
@@ -22,7 +22,7 @@ const defaultPictViewSettings = (
|
|
|
22
22
|
|
|
23
23
|
class PictView extends libFableServiceBase
|
|
24
24
|
{
|
|
25
|
-
constructor(pFable, pOptions, pServiceHash)
|
|
25
|
+
constructor(pFable, pOptions, pServiceHash, fCallback)
|
|
26
26
|
{
|
|
27
27
|
super(pFable, pOptions, pServiceHash);
|
|
28
28
|
this.options = this.fable.Utility.extend(defaultPictViewSettings, this.options);
|
|
@@ -120,9 +120,15 @@ class PictView extends libFableServiceBase
|
|
|
120
120
|
if (pError)
|
|
121
121
|
{
|
|
122
122
|
this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} did not auto initialize/render properly: ${pError}`, pError);
|
|
123
|
+
}
|
|
124
|
+
if (typeof(fCallback) === 'function')
|
|
125
|
+
{
|
|
126
|
+
return fCallback(pError);
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
{
|
|
123
130
|
return false;
|
|
124
131
|
}
|
|
125
|
-
return true;
|
|
126
132
|
});
|
|
127
133
|
}
|
|
128
134
|
|
package/source/Pict.js
CHANGED
|
@@ -48,7 +48,25 @@ class Pict extends libFable
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
// Just passing an options will construct one for us.
|
|
52
|
+
// Passing a hash will set the hash.
|
|
53
|
+
// Passing a prototype will use that!
|
|
54
|
+
addApplication(pOptions, pApplicationHash, pApplicationPrototype)
|
|
55
|
+
{
|
|
56
|
+
let tmpOptions = (typeof(pOptions) == 'object') ? pOptions : {};
|
|
57
|
+
let tmpApplicationHash = (typeof(pApplicationHash) == 'string') ? pApplicationHash : this.fable.getUUID();
|
|
58
|
+
|
|
59
|
+
if (typeof(pApplicationPrototype) != 'undefined')
|
|
60
|
+
{
|
|
61
|
+
return this.serviceManager.instantiateServiceProviderFromPrototype('PictView', tmpOptions, tmpApplicationHash, pApplicationPrototype);
|
|
62
|
+
}
|
|
63
|
+
else
|
|
64
|
+
{
|
|
65
|
+
return this.serviceManager.instantiateServiceProvider('PictView', tmpOptions, tmpApplicationHash);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
initializePictTemplates()
|
|
52
70
|
{
|
|
53
71
|
/*
|
|
54
72
|
*
|