gd-sprest-bs 10.4.7 → 10.4.9

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.
@@ -21,6 +21,7 @@ var _SPFxWebPart = /** @class */ (function () {
21
21
  /** The configuration modal. */
22
22
  // Constructor
23
23
  function _SPFxWebPart(props) {
24
+ var _this = this;
24
25
  this._cfg = null;
25
26
  this._props = null;
26
27
  /** The configuration form. */
@@ -45,23 +46,40 @@ var _SPFxWebPart = /** @class */ (function () {
45
46
  }
46
47
  catch (_a) { }
47
48
  }
48
- // See if this is a classic page
49
- if (gd_sprest_1.Helper.SP.Ribbon.exists) {
50
- // Set the flag
51
- isEdit = gd_sprest_1.Helper.WebPart.isEditMode();
52
- }
53
- else {
54
- // Set the flag
55
- isEdit = this._props.spfx.displayMode == gd_sprest_1.SPTypes.FormDisplayMode.Edit;
56
- }
57
- // Ensure we are in edit mode
58
- if (isEdit) {
49
+ // Set the webpart properties pane to trigger the modal from displaying
50
+ var propertyPageConfig = this._props.spfx.getPropertyPaneConfiguration;
51
+ this._props.spfx.getPropertyPaneConfiguration = function () {
52
+ // Display the modal
53
+ _this._modal.show();
54
+ // Call the original event
55
+ return propertyPageConfig ? propertyPageConfig() : null;
56
+ };
57
+ // See if this is the workbench
58
+ if (window.location.pathname.indexOf("workbench.aspx") > 0) {
59
59
  // Render the configuration button
60
60
  this.renderEdit();
61
+ // Render the solution
62
+ this.render();
61
63
  }
62
64
  else {
63
- // Render the webpart
64
- this.render();
65
+ // See if this is a classic page
66
+ if (gd_sprest_1.Helper.SP.Ribbon.exists) {
67
+ // Set the flag
68
+ isEdit = gd_sprest_1.Helper.WebPart.isEditMode();
69
+ }
70
+ else {
71
+ // Set the flag
72
+ isEdit = this._props.spfx.displayMode == gd_sprest_1.SPTypes.FormDisplayMode.Edit;
73
+ }
74
+ // Ensure we are in edit mode
75
+ if (isEdit) {
76
+ // Render the configuration button
77
+ this.renderEdit();
78
+ }
79
+ else {
80
+ // Render the webpart
81
+ this.render();
82
+ }
65
83
  }
66
84
  }
67
85
  Object.defineProperty(_SPFxWebPart.prototype, "Form", {