mirror of https://github.com/OCA/web.git
[IMP] Make web_environment_ribbon more generic
By creating the ribbon div on the fly, this module doesn't depend anymore on the webclient structure.pull/1071/head
parent
0618f7f5a4
commit
3c161f4139
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
.test-ribbon{
|
.test-ribbon{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
top: 50px;
|
top: 25px;
|
||||||
left: -50px;
|
left: -50px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
|
@ -14,10 +14,11 @@
|
||||||
-moz-transform: rotate(-45deg);
|
-moz-transform: rotate(-45deg);
|
||||||
-o-transform: rotate(-45deg);
|
-o-transform: rotate(-45deg);
|
||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
z-index: 1000;
|
z-index: 9999;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
box-shadow: 0 0 3px rgba(0,0,0,.3);
|
box-shadow: 0 0 3px rgba(0,0,0,.3);
|
||||||
background: rgba(255,0,0,.6);
|
background: rgba(255,0,0,.6);
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.test-ribbon b {
|
.test-ribbon b {
|
||||||
|
|
|
@ -27,9 +27,8 @@ function validStrColour(strToTest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
core.bus.on('web_client_ready', null, function () {
|
core.bus.on('web_client_ready', null, function () {
|
||||||
var ribbon = $('.test-ribbon');
|
var ribbon = $('<div class="test-ribbon"/>');
|
||||||
// If ribbon is found in DOM
|
$('body').append(ribbon);
|
||||||
if (ribbon.length) {
|
|
||||||
ribbon.hide();
|
ribbon.hide();
|
||||||
model.call('get_param', ['ribbon.name']).then(
|
model.call('get_param', ['ribbon.name']).then(
|
||||||
function (name) {
|
function (name) {
|
||||||
|
@ -55,7 +54,6 @@ core.bus.on('web_client_ready', null, function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}); // odoo.define
|
}); // odoo.define
|
||||||
|
|
|
@ -15,12 +15,4 @@
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</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>
|
</odoo>
|
||||||
|
|
Loading…
Reference in New Issue