gd-sprest-react
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -90,20 +90,39 @@ "use strict"; | ||
if (elWebPart) { | ||
var wpContent = null; | ||
var wpPageContent = null; | ||
// Update the configuration | ||
var cfg = elWebPart.querySelector("#" + _this.props.cfgElementId); | ||
cfg ? cfg.innerText = JSON.stringify(wpCfg) : null; | ||
// Get the associated webpart element id | ||
var wpId2 = elWebPart.getAttribute("webpartid2"); | ||
var elWPContent = wpId2 ? document.querySelector(".aspNetHidden input[name='" + wpId2 + "scriptcontent']") : null; | ||
if (elWPContent) { | ||
// Update the configuration in the webpart content element | ||
_this.updateConfigurationInElement(elWPContent, wpCfg); | ||
// Parse the hidden elements on the page | ||
var hiddenElements = document.querySelectorAll("input[type='hidden']"); | ||
for (var i = 0; hiddenElements.length; i++) { | ||
var elHidden = hiddenElements[i]; | ||
// See if we have found the webpart content and page content hidden elements | ||
if (wpContent && wpPageContent) { | ||
continue; | ||
} | ||
// See if this is the webpart content element | ||
if (elHidden.getAttribute("name") == "wpId" + "scriptcontent") { | ||
// Set the webpart content element | ||
wpContent = elHidden; | ||
// Update the configuration in the webpart content element | ||
_this.updateConfigurationInElement(wpContent, wpCfg); | ||
// Continue the loop | ||
continue; | ||
} | ||
// Create an element and set the inner html to the value | ||
var el = document.createElement("div"); | ||
el.innerHTML = elHidden.value; | ||
// See if this is a hidden field element | ||
if (elHidden.querySelector("#" + _this.props.cfgElementId)) { | ||
// Set the webpart page content | ||
wpPageContent = elHidden; | ||
// Update the configuration in the webpart content element | ||
_this.updateConfigurationInElement(wpPageContent, wpCfg); | ||
// Continue the loop | ||
continue; | ||
} | ||
} | ||
// Get the content for the page | ||
var elPageContent = document.querySelector("input[id$='TextField_spSave']"); | ||
if (elPageContent) { | ||
// Update the configuration in the webpart content element | ||
_this.updateConfigurationInElement(elPageContent, wpCfg); | ||
} | ||
// Return true, if the content element exists | ||
return elPageContent != null; | ||
// Return true, if the page content exists | ||
return wpPageContent != null; | ||
} | ||
@@ -110,0 +129,0 @@ // Webpart is not in a content field |
{ | ||
"name": "gd-sprest-react", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "SharePoint react components.", | ||
@@ -34,3 +34,3 @@ "main": "build/index.js", | ||
"gd-sprest": "*", | ||
"office-ui-fabric-react": "^4.21.1", | ||
"office-ui-fabric-react": "^4.21.3", | ||
"react": "^15.6.1", | ||
@@ -40,3 +40,3 @@ "react-dom": "^15.6.1" | ||
"devDependencies": { | ||
"@types/react": "^15.0.35", | ||
"@types/react": "15.0.35", | ||
"@types/react-dom": "^15.5.1", | ||
@@ -50,5 +50,5 @@ "babel-core": "^6.25.0", | ||
"style-loader": "^0.18.2", | ||
"ts-loader": "^2.3.0", | ||
"ts-loader": "^2.3.1", | ||
"webpack": "^2.7.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
175267
2925
+ Addedgd-sprest@9.0.3(transitive)
- Removedgd-sprest@8.9.9(transitive)