[IMP] website snippet: increase speed of dom_filter
bzr revid: chm@openerp.com-20130917074050-ab22448v4x1d26lf
This commit is contained in:
@@ -73,10 +73,17 @@
|
||||
$("body").on('DOMNodeInserted', hack_to_add_snippet_id);
|
||||
},
|
||||
dom_filter: function (dom) {
|
||||
var $errordom = $("#oe_manipulators, #website-top-navbar");
|
||||
return $(dom).filter(function () {
|
||||
return $.contains($errordom, this) || $.inArray(this, $errordom);
|
||||
var sdom = dom.split(',');
|
||||
var exclude = ":not(#oe_manipulators):not(#website-top-navbar)";
|
||||
dom = "";
|
||||
_.each(sdom, function (val) {
|
||||
val = val.replace(/^\s+|\s+$/g, '');
|
||||
dom += "body > " + exclude + " " + val + ", ";
|
||||
val = val.split(" ");
|
||||
dom += "body > "+ val.shift() + exclude + val.join(" ") + ", ";
|
||||
});
|
||||
dom = dom.replace(/,\s*$/g, '');
|
||||
return $(dom);
|
||||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<div class='oe_snippet_thumbnail oe_label'>Darken</div>
|
||||
</div>
|
||||
|
||||
<div t-name="website.snippets.well" data-snippet-id='well' data-category='content' data-selector-siblings='div, p, h1, h2, h3, blockquote'>
|
||||
<div t-name="website.snippets.well" data-snippet-id='well' data-category='content' data-selector-siblings='p, h1, h2, h3, blockquote'>
|
||||
<div class='oe_snippet_thumbnail oe_label'>Well</div>
|
||||
<div class="oe_snippet_body well">
|
||||
Manage your sales funnel with no effort with OpenERP CRM. Attract
|
||||
@@ -108,7 +108,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div t-name="website.snippets.quote" data-snippet-id='quote' data-category='content' data-selector-siblings='div, p, h1, h2, h3, blockquote'>
|
||||
<div t-name="website.snippets.quote" data-snippet-id='quote' data-category='content' data-selector-siblings='p, h1, h2, h3, blockquote'>
|
||||
<div class='oe_snippet_thumbnail oe_label'>Quote</div>
|
||||
<blockquote class="oe_snippet_body">
|
||||
<p>
|
||||
@@ -119,7 +119,7 @@
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div t-name="website.snippets.panel" data-snippet-id='panel' data-category='content' data-selector-siblings='div, p, h1, h2, h3, blockquote'>
|
||||
<div t-name="website.snippets.panel" data-snippet-id='panel' data-category='content' data-selector-siblings='p, h1, h2, h3, blockquote'>
|
||||
<div class='oe_snippet_thumbnail oe_label'>Panel</div>
|
||||
<div class="oe_snippet_body panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
||||
Reference in New Issue
Block a user