mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-20 02:37:55 +08:00
Changed to manual bootstrapping of LayoutEditor Angular app. Fixes #5722.
This commit is contained in:
@@ -26,11 +26,12 @@
|
|||||||
Style.Include("LayoutEditor.css", "LayoutEditor.min.css");
|
Style.Include("LayoutEditor.css", "LayoutEditor.min.css");
|
||||||
Script.Include("LayoutDesignerHost.js");
|
Script.Include("LayoutDesignerHost.js");
|
||||||
|
|
||||||
// The grid system
|
// The grid system.
|
||||||
Style.Include("default-grid.css");
|
Style.Include("default-grid.css");
|
||||||
|
|
||||||
using (Script.Foot()) {
|
using (Script.Foot()) {
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
angular
|
angular
|
||||||
.module("LayoutEditor")
|
.module("LayoutEditor")
|
||||||
.constant("environment", {
|
.constant("environment", {
|
||||||
@@ -38,7 +39,10 @@
|
|||||||
return "@Url.Action("Get", "Template", new { area = "Orchard.Layouts" })" + "/" + templateName;
|
return "@Url.Action("Get", "Template", new { area = "Orchard.Layouts" })" + "/" + templateName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
jQuery(function () {
|
|
||||||
|
angular.bootstrap($(".layout-editor-holder")[0], ["LayoutEditor"]);
|
||||||
|
|
||||||
|
$(function () {
|
||||||
var editorConfig = JSON.parse(LayoutEditor.decode("@Html.Raw(Url.Encode(Model.ConfigurationData))"));
|
var editorConfig = JSON.parse(LayoutEditor.decode("@Html.Raw(Url.Encode(Model.ConfigurationData))"));
|
||||||
var editorCanvasData = JSON.parse(LayoutEditor.decode("@Html.Raw(Url.Encode(Model.Data))"));
|
var editorCanvasData = JSON.parse(LayoutEditor.decode("@Html.Raw(Url.Encode(Model.Data))"));
|
||||||
var layoutEditor = window.layoutEditor = new LayoutEditor.Editor(editorConfig, editorCanvasData);
|
var layoutEditor = window.layoutEditor = new LayoutEditor.Editor(editorConfig, editorCanvasData);
|
||||||
@@ -56,6 +60,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +107,7 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div class="layout-editor-holder">
|
<div class="layout-editor-holder">
|
||||||
<orc-layout-editor model="window.layoutEditor" ng-app="LayoutEditor" />
|
<orc-layout-editor model="window.layoutEditor" />
|
||||||
</div>
|
</div>
|
||||||
@Display.DialogTemplate(Name: "Layout")
|
@Display.DialogTemplate(Name: "Layout")
|
||||||
<div class="layout-editor-help-dialog" title="@T("Layout editor help")">
|
<div class="layout-editor-help-dialog" title="@T("Layout editor help")">
|
||||||
|
Reference in New Issue
Block a user