From 4072e336a296a8da873b2b69cfb00d379a41c67c Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 15 May 2015 11:14:46 +0200 Subject: [FIX] Cross-addons: Kanban templates: records editable/deletable for the sake of compatibility with the communication logic in the new Kanban implementation. --- addons/website/static/src/js/website.backend.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'addons/website/static/src/js/website.backend.js') diff --git a/addons/website/static/src/js/website.backend.js b/addons/website/static/src/js/website.backend.js index b1920dc4cab..d1bb6c2f5b0 100644 --- a/addons/website/static/src/js/website.backend.js +++ b/addons/website/static/src/js/website.backend.js @@ -9,10 +9,13 @@ var form_widgets = require('web.form_widgets'); // required to guarantee that var WidgetWebsiteButton = form_common.AbstractField.extend({ template: 'WidgetWebsiteButton', render_value: function() { + // Hack to replace false value by unpublished because falsy form fields + // have classname o_form_field_empty and are hidden + if (!this.get_value()) { + this.set_value('unpublished'); + } this._super(); - this.$() - .toggleClass("success", this.get_value()) - .toggleClass("danger", !this.get_value()); + this.$el.toggleClass("published", this.get_value() === true); if (this.node.attrs.class) { this.$el.addClass(this.node.attrs.class); } -- cgit v1.2.3