mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 19:34:40 +08:00
#19013: Fixing JSon formatting in widgets editor
Work Item: 19013 --HG-- branch : 1.x
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
Script.Require("jQuery");
|
||||
IEnumerable<LayerPart> layers = Model.Layers;
|
||||
}
|
||||
@functions {
|
||||
static string EncodeLineBreaks(string text) {
|
||||
return text.Replace(Environment.NewLine, "\\\\n");
|
||||
}
|
||||
}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
document.write("<div id=\"widgets-layer-visibility\"><h3>@T("All Layers:")</h3></div>");
|
||||
@@ -16,7 +21,7 @@
|
||||
var currentLayerId = @Model.CurrentLayer.Id;
|
||||
var layers = [
|
||||
@foreach (var layer in layers) {
|
||||
<text>{"name":"@layer.Name","description":"@layer.Description","id":@layer.Id}@(layer != layers.Last() ? "," : "")</text>
|
||||
<text>{"name":"@layer.Name","description":"@EncodeLineBreaks(layer.Description)","id":@layer.Id}@(layer != layers.Last() ? "," : "")</text>
|
||||
}
|
||||
];
|
||||
var visWrapper = $("#widgets-layer-visibility");
|
||||
|
Reference in New Issue
Block a user