From ac3bfee8f387a43dea00dc9054fc744152922261 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 1 Aug 2017 14:07:19 +0200 Subject: [PATCH] [FIX] website: fix html editor view to be edited Before this commit, the view selected to be edited by the html editor was the wrong one This was caused by the simplification brought about by commit a2ae219d4ee283b7e7af84a3e7fa3bb8e0a95f23 which transfered from python to js the decision to make a view a header for the [customize] menu (on the website In this case, the first view in the return list of python was the header, and the second the actual view Now that python just sends a list of unique views without any distinction whatsoever, the right view to pick when entering the html editor is the first one, at index 0 opw 760279 Closes #18603 --- addons/website/static/src/js/website.ace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js index 630a8919a2f..760f2d3146f 100644 --- a/addons/website/static/src/js/website.ace.js +++ b/addons/website/static/src/js/website.ace.js @@ -57,7 +57,7 @@ var ViewEditor = AceCommon.ViewEditor.extend({ self.$('#ace-view-list').val(viewId).change(); } else { if (views.length >= 2) { - var mainTemplate = views[1]; + var mainTemplate = views[0]; self.$('#ace-view-list').val(mainTemplate.id).trigger('change'); } window.location.hash = hash;