ソースを参照

HUE-3294 [core] Make the editor load completely

Enrico Berti 9 年 前
コミット
15d85fb

+ 1 - 7
desktop/core/src/desktop/templates/responsive.mako

@@ -287,7 +287,6 @@ ${ hueIcons.symbols() }
       <a href="javascript: void(0);" title="${_('Toggle Assist')}" class="pointer show-assist" style="display:none;">
         <i class="fa fa-chevron-right"></i>
       </a>
-      ##<div data-bind='component: currentApp'></div>
       <div data-bind='text: currentApp'></div>
       <!-- ko if: isLoadingEmbeddable -->
       <i class="fa fa-spinner fa-spin"></i>
@@ -313,15 +312,10 @@ ${ hueIcons.symbols() }
 <script src="${ static('desktop/ext/js/knockout-sortable.min.js') }"></script>
 <script src="${ static('desktop/js/ko.editable.js') }"></script>
 <script src="${ static('desktop/js/ko.hue-bindings.js') }"></script>
+<script src="${ static('desktop/js/jquery.scrollup.js') }"></script>
 
 ${ assist.assistJSModels() }
 
-## Dynamic loading of apps
-##<script src="${ static('desktop/ext/js/text.js') }"></script>
-##<script src="${ static('desktop/js/ko.editor.js') }"></script>
-##<script src="${ static('desktop/js/ko.metastore.js') }"></script>
-
-
 ${ assist.assistPanel() }
 
 <a title="${_('Toggle Assist')}" class="pointer show-assist" data-bind="visible: !$root.isLeftPanelVisible() && $root.assistAvailable(), click: function() { $root.isLeftPanelVisible(true); }">

+ 2 - 0
desktop/libs/notebook/src/notebook/templates/editor.mako

@@ -26,6 +26,7 @@
 
 ${ commonheader(_('Editor'), editor_type, user, request, "68px") | n,unicode }
 
+<span id="editorComponents">
 ${ editorComponents.includes() }
 
 <style type="text/css">
@@ -44,5 +45,6 @@ ${ notebookKoComponents.downloadSnippetResults() }
 ${ notebookKoComponents.snippetDbSelection() }
 
 ${ editorComponents.commonJS() }
+</span>
 
 ${ commonfooter(request, messages) | n,unicode }

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -3500,7 +3500,7 @@ ${ hueIcons.symbols() }
       % else:
       viewModel = new EditorViewModel(${ editor_id or 'null' }, ${ notebooks_json | n,unicode }, VIEW_MODEL_OPTIONS);
       % endif
-      ko.applyBindings(viewModel);
+      ko.applyBindings(viewModel, $('#editorComponents')[0]);
       viewModel.init();
 
       if (location.getParameter("github_status") != "") {

+ 2 - 0
desktop/libs/notebook/src/notebook/templates/editor_embeddable.mako

@@ -24,6 +24,7 @@
 <%namespace name="editorComponents" file="editor_components.mako" />
 <%namespace name="notebookKoComponents" file="notebook_ko_components.mako" />
 
+<span id="editorComponents">
 ${ editorComponents.includes() }
 
 <style type="text/css">
@@ -43,3 +44,4 @@ ${ notebookKoComponents.snippetDbSelection() }
 
 ${ editorComponents.commonJS() }
 
+</span>