Browse Source

Merge pull request #424 from syleam/9.0-environment_ribbon

[IMP] Make web_environment_ribbon more generic
pull/341/merge
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
6176c10c05
  1. 5
      web_environment_ribbon/static/src/css/ribbon.css
  2. 6
      web_environment_ribbon/static/src/js/ribbon.js
  3. 8
      web_environment_ribbon/view/base_view.xml

5
web_environment_ribbon/static/src/css/ribbon.css

@ -3,7 +3,7 @@
.test-ribbon{
width: 200px;
top: 50px;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
@ -14,10 +14,11 @@
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
z-index: 1000;
z-index: 9999;
position: fixed;
box-shadow: 0 0 3px rgba(0,0,0,.3);
background: rgba(255,0,0,.6);
pointer-events: none;
}
.test-ribbon b {

6
web_environment_ribbon/static/src/js/ribbon.js

@ -27,9 +27,8 @@ function validStrColour(strToTest) {
}
core.bus.on('web_client_ready', null, function () {
var ribbon = $('.test-ribbon');
// If ribbon is found in DOM
if (ribbon.length) {
var ribbon = $('<div class="test-ribbon"/>');
$('body').append(ribbon);
ribbon.hide();
model.call('get_param', ['ribbon.name']).then(
function (name) {
@ -55,7 +54,6 @@ core.bus.on('web_client_ready', null, function () {
}
}
);
}
});
}); // odoo.define

8
web_environment_ribbon/view/base_view.xml

@ -15,12 +15,4 @@
</xpath>
</template>
<!-- Add ribbon to page -->
<template id="body_with_ribbon_test" name="ribbon_test web.webclient_bootstrap"
inherit_id="web.webclient_bootstrap">
<xpath expr="//div[@class='openerp openerp_webclient_container oe_webclient']" position="before">
<div class="test-ribbon"/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save