summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/snippets.editor.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-08-12 15:34:00 +0200
committerqsm-odoo <qsm@odoo.com>2016-08-19 17:44:28 +0200
commitb4cfe36b05ebcc11bb49eaf1e72277ec8ec49954 (patch)
tree86cc3a9247673f232a4cf35119413958df1bd507 /addons/web_editor/static/src/js/snippets.editor.js
parentcc2cd9108c44771c6908bdc95bc23486a712e23c (diff)
[IMP] *: replace snippet sections menu by a title
* web_editor, website, mass_mailing This menu allowed to scroll to the snippets sections by clicking on their corresponding icons. It was useless as the sections are not taking a lot of height. This also appeared buggy as clicking on the last icon highlighted only the second one as this second one was still the first section visible on the screen when the last section was fully visible. This also added fours buttons to the interface which contains already a lot of them. Now this is replaced by a title "Add blocks" which makes the editor cleaner and also improved the performance to enter the edit mode.
Diffstat (limited to 'addons/web_editor/static/src/js/snippets.editor.js')
-rw-r--r--addons/web_editor/static/src/js/snippets.editor.js34
1 files changed, 0 insertions, 34 deletions
diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js
index 3e01f825b48..1549db18689 100644
--- a/addons/web_editor/static/src/js/snippets.editor.js
+++ b/addons/web_editor/static/src/js/snippets.editor.js
@@ -158,23 +158,12 @@ data.Class = Widget.extend({
compute_snippet_templates: function (html) {
var self = this;
var $html = $(html);
- var $ul = $html.siblings("ul");
var $scroll = $html.siblings("#o_scroll");
if (!$scroll.length) {
throw new Error("Wrong snippets xml definition");
}
- $ul.children().tooltip({
- delay: { "show": 500, "hide": 100 },
- container: 'body',
- title: function () {
- return (navigator.appVersion.indexOf('Mac') > -1 ? 'CMD' : 'CTRL')+'+SHIFT+'+($(this).index()+1);
- },
- trigger: 'hover',
- placement: 'top'
- }).on('click', function () {$(this).tooltip('hide');});
-
// t-snippet
$html.find('[data-oe-type="snippet"]').each(function () {
$(this).children().attr('data-oe-type', "snippet").attr('data-oe-thumbnail', $(this).data('oe-thumbnail'));
@@ -296,29 +285,6 @@ data.Class = Widget.extend({
this.$el.html($html);
- // animate for list of snippet blocks
- this.$el.on('click', '.scroll-link', function (event) {
- event.preventDefault();
- var targetOffset = $($(this).attr("href")).position().top - $ul.outerHeight() + $scroll[0].scrollTop;
- $scroll.animate({'scrollTop': targetOffset}, 750);
- });
- $scroll.on('scroll', function () {
- var middle = $scroll.height()/4;
- var $li = $ul.find("a").parent().removeClass('active');
- var last;
- for (var k=0; k<$li.length; k++) {
- var li = $($li[k]);
- if (!li.data('target')) {
- li.data('target', $($("a", li).attr("href")));
- }
- if (li.data('target').position().top > middle) {
- break;
- }
- last = $li[k];
- }
- $(last).addClass("active");
- });
-
self.make_snippet_draggable(self.$snippets);
this.associate_snippet_names(this.$snippets);
},