Browse Source

[IMP] reduce size of input fields, change color of border when touched

pull/4/head
Guewen Baconnier 11 years ago
parent
commit
0e25e20bab
  1. 7
      web_translate_dialog_page/static/src/css/base.css
  2. 9
      web_translate_dialog_page/static/src/js/web_translate_dialog_page.js
  3. 4
      web_translate_dialog_page/static/src/xml/base.xml

7
web_translate_dialog_page/static/src/css/base.css

@ -1,3 +1,6 @@
.oe_field_translate {
/* visibility: hidden; */
.openerp .oe_trad_field {
width: 95%;
}
.openerp .oe_trad_field.touched {
border: 1px solid green !important;
} }

9
web_translate_dialog_page/static/src/js/web_translate_dialog_page.js

@ -30,7 +30,10 @@ openerp.web_translate_dialog_page = function (instance) {
template: "TranslateDialogPage", template: "TranslateDialogPage",
dialog_title: {toString: function () { return _t("Translations"); }}, dialog_title: {toString: function () { return _t("Translations"); }},
init: function(parent, options, content) { init: function(parent, options, content) {
this._super(parent, options, content);
this._super(parent,
{width: '90%',
height: '80%'},
content);
this.view_language = this.session.user_context.lang; this.view_language = this.session.user_context.lang;
this.view = parent; this.view = parent;
this.view_type = parent.fields_view.type || ''; this.view_type = parent.fields_view.type || '';
@ -104,8 +107,8 @@ openerp.web_translate_dialog_page = function (instance) {
// the buggy event is not bound to $(window), then we restore // the buggy event is not bound to $(window), then we restore
// a percentage width and bind the "normal" event without the // a percentage width and bind the "normal" event without the
// CHM's buggy change. // CHM's buggy change.
$cleditor.$main.width('100%');
$cleditor.options.width = '100%';
$cleditor.$main.width('95%');
$cleditor.options.width = '95%';
$(window).resize(function() { $(window).resize(function() {
//Forcefully blurred iframe contentWindow, chrome, IE, safari doesn't trigger blur on window resize and due to which text disappears //Forcefully blurred iframe contentWindow, chrome, IE, safari doesn't trigger blur on window resize and due to which text disappears
var contentWindow = $cleditor.$frame[0].contentWindow; var contentWindow = $cleditor.$frame[0].contentWindow;

4
web_translate_dialog_page/static/src/xml/base.xml

@ -15,8 +15,8 @@
<label class="oe_label"><t t-esc="field.string"/>:</label> <label class="oe_label"><t t-esc="field.string"/>:</label>
</td> </td>
<td t-foreach="widget.languages" t-as="lg" class="oe_form_frame_cell"> <td t-foreach="widget.languages" t-as="lg" class="oe_form_frame_cell">
<input t-if="field.field.type == 'char' || field.field.type == 'url'" type="text" t-attf-name="#{lg.code}-#{field.name}" value="" data-value="" class="oe_trad_field" style="width: 100%"/>
<textarea t-if="field.field.type == 'text'" t-attf-name="#{lg.code}-#{field.name}" data-value="" class="oe_trad_field" style="width: 100%"></textarea>
<input t-if="field.field.type == 'char' || field.field.type == 'url'" type="text" t-attf-name="#{lg.code}-#{field.name}" value="" data-value="" class="oe_trad_field"/>
<textarea t-if="field.field.type == 'text'" t-attf-name="#{lg.code}-#{field.name}" data-value="" class="oe_trad_field" ></textarea>
<div t-if="field.field.type == 'html'" class="oe_form_field_html"> <div t-if="field.field.type == 'html'" class="oe_form_field_html">
<textarea class="oe_trad_field oe_form_field" t-attf-name="#{lg.code}-#{field.name}" data-value=""/> <textarea class="oe_trad_field oe_form_field" t-attf-name="#{lg.code}-#{field.name}" data-value=""/>
</div> </div>

Loading…
Cancel
Save