Skip to content
Permalink
Browse files

[IMP] Base: Custom CopyClipboardCharLong widget : delete custom scss …

…and rely on standard odoo class
  • Loading branch information...
arj-odoo committed Oct 9, 2019
1 parent dd6f0bf commit 5df94e3495e31671a44f9339f893a1ef3e7af6ab
@@ -18,10 +18,10 @@
</group>
</group>
<group>
<field name="link" readonly="1" widget="CopyClipboardCharLong"/>
<field name="link" readonly="1" widget="CopyClipboardCharLong"/>
</group>
<footer>
<button string="Close" class="btn-primary" special="cancel"/>
<button string="Close" class="btn-primary" special="cancel"/>
</footer>
</form>
</field>
@@ -1630,23 +1630,24 @@ var CharCopyClipboard = FieldChar.extend(CopyClipboard, {
description: _lt("Copy to Clipboard"),
clipboardTemplate: 'CopyClipboardChar',

_truncate: function () {
var self = this;
self.$el.attr('id', 'long_char_copy_clipboard');
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------

/**
* @override
* @private
*/
_renderReadonly: function () {
this._super.apply(this, arguments);
if (this.value) {
this.$el.append($(qweb.render(this.clipboardTemplate)));
this.$el.addClass('o_text_overflow');
this._initClipboard();
this._truncate();
}
}

});


var AbstractFieldBinary = AbstractField.extend({
events: _.extend({}, AbstractField.prototype.events, {
'change .o_input_file': 'on_file_change',
@@ -491,11 +491,3 @@ button.o_field_float_toggle {
select.o_field_widget.o_input {
padding: 1px; // Other inputs get a 1px padding automatically added by the browsers but selects do not
}

#long_char_copy_clipboard {
width: 750px !important;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
}
@@ -897,14 +897,9 @@
</button>
</t>
<t t-name="CopyClipboardCharLong">
<!-- style="padding: 5px;position: absolute;top: 0;height: 100%;padding-top: 2px;"-->
<button class="btn btn-sm btn-primary o_clipboard_button o_btn_char_copy" >
<button class="btn btn-sm btn-primary o_clipboard_button o_btn_char_copy">
<span class="fa fa-clipboard"></span><span> Copy Text</span>
</button>
<!-- style="padding: 25px;position: absolute;top: 0;height: 100%;padding-top: 2px;"-->
<!-- <button class="btn btn-sm btn-secondary o_reveal_button" style="display:block">-->
<!-- <span class="fa fa-eye"></span><span> Reveal Text</span>-->
<!-- </button>-->
</t>
<t t-name="FieldBinaryFile">
<a t-if="widget.mode === 'readonly'" href="javascript:void(0)" class="o_form_uri"/>

0 comments on commit 5df94e3

Please sign in to comment.
You can’t perform that action at this time.