Browse Source

publish muk_web_utils - 12.0

pull/62/head
MuK IT GmbH 6 years ago
parent
commit
d067015d2e
  1. 2
      muk_web_utils/__manifest__.py
  2. 18
      muk_web_utils/static/src/js/fields/binary.js
  3. 13
      muk_web_utils/static/src/js/fields/image.js
  4. 2
      muk_web_utils/static/src/scss/image.scss

2
muk_web_utils/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Web Utils",
"summary": """Utility Features""",
"version": "12.0.2.8.13",
"version": "12.0.2.8.15",
"category": "Extra Tools",
"license": "AGPL-3",
"author": "MuK IT",

18
muk_web_utils/static/src/js/fields/binary.js

@ -38,16 +38,16 @@ fields.FieldBinaryFile.include({
}.bind(this));
return this._super.apply(this, arguments);
},
_renderReadonly: function () {
this._super.apply(this, arguments);
var $wrapper = $('<div/>', {
class: "mk_field_binary_wrapper"
});
fields.FieldBinaryImage.include({
willStart: function () {
var def = this._rpc({
route: '/params/muk_web_utils.binary_max_size',
}).done(function(result) {
this.max_upload_size = result.max_upload_size * 1024 * 1024;
}.bind(this));
return this._super.apply(this, arguments);
$wrapper.addClass(this.$el.attr('class'));
this.$el.removeClass("o_field_widget");
this.$el.removeClass("o_hidden");
$wrapper.append(this.$el);
this.setElement($wrapper);
},
});

13
muk_web_utils/static/src/js/fields/image.js

@ -44,13 +44,20 @@ var _t = core._t;
var QWeb = core.qweb;
fields.FieldBinaryImage.include({
willStart: function () {
var def = this._rpc({
route: '/params/muk_web_utils.binary_max_size',
}).done(function(result) {
this.max_upload_size = result.max_upload_size * 1024 * 1024;
}.bind(this));
return this._super.apply(this, arguments);
},
_render: function () {
this._super.apply(this, arguments);
this.$('.mk_form_image_wrapper').remove();
this.$('img').wrap($('<div/>', {
class: "mk_form_image_wrapper"
class: "mk_field_image_wrapper"
}));
var $wrapper = $('.mk_form_image_wrapper');
var $wrapper = $('.mk_field_image_wrapper');
var width = this.nodeOptions.size ?
this.nodeOptions.size[0] : this.attrs.width;
var height = this.nodeOptions.size ?

2
muk_web_utils/static/src/scss/image.scss

@ -19,7 +19,7 @@
.o_field_widget.o_field_image {
@include media-breakpoint-up(sm, $o-extra-grid-breakpoints) {
.mk_form_image_wrapper {
.mk_field_image_wrapper {
min-height: 60px;
min-width: 80px;
}

Loading…
Cancel
Save