diff --git a/api/js/etemplate/et2_widget_textbox.js b/api/js/etemplate/et2_widget_textbox.js index 084b6eabbc..3fe4e71d48 100644 --- a/api/js/etemplate/et2_widget_textbox.js +++ b/api/js/etemplate/et2_widget_textbox.js @@ -249,6 +249,7 @@ var et2_textbox = (function(){ "use strict"; return et2_inputWidget.extend([et2_ */ set_readonly: function(_readonly) { this.input.attr("readonly", _readonly); + this.input.toggleClass('et2_textbox_ro', _readonly); }, set_blur: function(_value) { diff --git a/calendar/js/app.js b/calendar/js/app.js index cc5b89aedf..6da8c3a0e7 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -1121,15 +1121,36 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( }, /** - * Change participant add button status based on - * participants field value + * On change participant event, try to set add button status based on + * participant field value. Additionally, disable/enable quantity field + * if there's none resource value or there are more than one resource selected. * */ - participantOnChange: function () { + participantOnChange: function () + { var add = this.et2.getWidgetById('add'); + var quantity = this.et2.getWidgetById('quantity'); var participant = this.et2.getWidgetById('participant'); - add.set_readonly(participant.get_value().length <= 0); + // array of participants + var value = participant.get_value(); + + add.set_readonly(value.length <= 0); + + quantity.set_readonly(false); + + // number of resources + var nRes = 0; + + for (var i=0;i