Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

adding badge with java script to images not removeable ?

By
joachim grubelnik
on 3/2/15, 10:29 AM 526 views

Hello!

I added an option at the customize menü where i added a class which loads a badge :after the image. 

when i click my snippet option this adds the class and after the reload of the page the JS adds the class and the badge to the image --> OK 

the JS --> myjs.js:

 $(document).ready( function() { $('img.img_badge-header').after('<img src="/website_theme/static/src/img/badge/img_badge-test.png" class="img_badge-header-after">'); });

the CSS:

.img_badge-header-after {

//background-color: @bg_yellow;

width: 100px;

height: 200px;

position: absolute;

top: 70%;

right: 10%;

}

load in website_template.xml JS :

<template id="assets_frontend" inherit_id="website.assets_frontend" name="my theme">

<xpath expr="." position="inside"> <script src="/website/static/src/js/myjs.js"></script>

<!-- <script type="text/javascript" src="/website/static/src/js/sticky.js"></script>-->

</xpath>

</template>

the Snippet Option: 

<xpath expr="//div[@data-snippet-option-id='transform']//li" position="after">

<li class="dropdown-submenu" data-required="true"> <a tabindex="-1" href="#">Badges</a> <ul class="dropdown-menu"> <li class="dropdown-submenu"> <a tabindex="-2" href="#">Positionierung</a> <ul class="dropdown-menu"> <li data-value='pfot_img_badge-header'><a>Header-Badge</a></li> </ul> </li> </ul> </li>

now i ihave the problem that the badge is shown all the time, is this a caching problem or is the java script not loaded again  ? 

Is it written into database ? or how can i remove the badge again  ?

cheers joe

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/2/15, 10:29 AM
Seen: 526 times
Last updated: 3/16/15, 8:10 AM