Skip to content

Commit

Permalink
Bugfix: allow editing empty JSLink
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-markeev committed Mar 17, 2017
1 parent ddf5e37 commit ab6636a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Code/SharePoint/SPActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ module CSREditor {
context.load(properties);

context.executeQueryAsync(function () {
window["g_Cisar_JSLink"] = properties.get_item("JSLink").toLowerCase();
window["g_Cisar_JSLink"] = (properties.get_item("JSLink") || "").toLowerCase();
},
function () {
window["g_Cisar_JSLink"] = 'error';
Expand Down Expand Up @@ -485,7 +485,7 @@ module CSREditor {
context.load(properties);

context.executeQueryAsync(function () {
var oldJsLinkString = properties.get_item("JSLink").toLowerCase();
var oldJsLinkString = (properties.get_item("JSLink") || "").toLowerCase();

var toCheck = [];
if (path.indexOf(_spPageContextInfo.webServerRelativeUrl) == 0) {
Expand Down Expand Up @@ -569,7 +569,7 @@ module CSREditor {
return "(" + SPActions.waitForGlobal + ")('" + globalVar + "');";
}
private static waitForGlobal(globalVar: string) {
if (window[globalVar]) {
if (window[globalVar] != null) {
var result = window[globalVar];
delete window[globalVar];
return result;
Expand Down
6 changes: 3 additions & 3 deletions Scripts/csr-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ var CSREditor;
var properties = webpart.get_properties();
context.load(properties);
context.executeQueryAsync(function () {
window["g_Cisar_JSLink"] = properties.get_item("JSLink").toLowerCase();
window["g_Cisar_JSLink"] = (properties.get_item("JSLink") || "").toLowerCase();
}, function () {
window["g_Cisar_JSLink"] = 'error';
});
Expand Down Expand Up @@ -1264,7 +1264,7 @@ var CSREditor;
var properties = webpart.get_properties();
context.load(properties);
context.executeQueryAsync(function () {
var oldJsLinkString = properties.get_item("JSLink").toLowerCase();
var oldJsLinkString = (properties.get_item("JSLink") || "").toLowerCase();
var toCheck = [];
if (path.indexOf(_spPageContextInfo.webServerRelativeUrl) == 0) {
toCheck.push(['~site', _spPageContextInfo.webServerRelativeUrl]);
Expand Down Expand Up @@ -1336,7 +1336,7 @@ var CSREditor;
return "(" + SPActions.waitForGlobal + ")('" + globalVar + "');";
};
SPActions.waitForGlobal = function (globalVar) {
if (window[globalVar]) {
if (window[globalVar] != null) {
var result = window[globalVar];
delete window[globalVar];
return result;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Cisar",
"homepage_url": "https://github.com/andrei-markeev/cisar",
"version": "2.1",
"version": "2.1.2",
"description": "SharePoint CSR Live Edit",
"icons": {
"48": "AppIcon48.png",
Expand Down

0 comments on commit ab6636a

Please sign in to comment.