Skip to content

Commit

Permalink
Need to reference the window object for global variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjandatta committed Aug 27, 2024
1 parent fd2b6b3 commit 3147f84
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/gd-sprest.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gd-sprest.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gd-sprest",
"version": "8.1.8",
"version": "8.1.9",
"description": "An easy way to develop against the SharePoint REST API.",
"author": "Gunjan Datta <[email protected]> (https://gunjandatta.github.io)",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/helper/webpart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ class _WebPart {
}

// Get the form
let form = MSOWebPartPageFormName ? document.forms[MSOWebPartPageFormName] : null;
let formName = window["MSOWebPartPageFormName"];
let form = formName ? document.forms[formName] : null;
if (form) {
// Get the wiki page mode
let wikiPageMode: any = form._wikiPageMode ? form._wikiPageMode.value : null;
Expand Down
2 changes: 1 addition & 1 deletion src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IREST } from "../@types";
* SharePoint REST Library
*/
export const $REST: IREST = {
__ver: 8.18,
__ver: 8.19,
AppContext: (siteUrl: string) => { return Lib.Site.getAppContext(siteUrl); },
Apps: Lib.Apps,
ContextInfo: Lib.ContextInfo,
Expand Down

0 comments on commit 3147f84

Please sign in to comment.