mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 21:01:30 +02:00
Fix et2_checkbox_ro widget for exceptional cases when we pass value as Non-Boolean
This commit is contained in:
parent
43e1bfcc12
commit
54ab073cab
@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which implements the "checkbox" XET-Tag
|
* Class which implements the "checkbox" XET-Tag
|
||||||
*
|
*
|
||||||
* @augments et2_inputWidget
|
* @augments et2_inputWidget
|
||||||
*/
|
*/
|
||||||
var et2_checkbox = et2_inputWidget.extend(
|
var et2_checkbox = et2_inputWidget.extend(
|
||||||
{
|
{
|
||||||
attributes: {
|
attributes: {
|
||||||
@ -60,7 +60,7 @@ var et2_checkbox = et2_inputWidget.extend(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @memberOf et2_checkbox
|
* @memberOf et2_checkbox
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
@ -95,7 +95,7 @@ var et2_checkbox = et2_inputWidget.extend(
|
|||||||
*/
|
*/
|
||||||
set_value: function(_value) {
|
set_value: function(_value) {
|
||||||
if(_value != this.value) {
|
if(_value != this.value) {
|
||||||
if(_value == this.options.selected_value ||
|
if(_value == this.options.selected_value ||
|
||||||
_value && this.options.selected_value == this.__proto__.attributes.selected_value["default"] &&
|
_value && this.options.selected_value == this.__proto__.attributes.selected_value["default"] &&
|
||||||
_value != this.options.unselected_value) {
|
_value != this.options.unselected_value) {
|
||||||
this.input.prop("checked", true);
|
this.input.prop("checked", true);
|
||||||
@ -135,7 +135,7 @@ var et2_checkbox_ro = et2_checkbox.extend(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @memberOf et2_checkbox_ro
|
* @memberOf et2_checkbox_ro
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
@ -147,9 +147,14 @@ var et2_checkbox_ro = et2_checkbox.extend(
|
|||||||
|
|
||||||
this.setDOMNode(this.span[0]);
|
this.setDOMNode(this.span[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* note: checkbox is checked if even there is a value but not only if the _value is only "true"
|
||||||
|
* it's an exceptional validation for cases that we pass non boolean values as checkbox _value
|
||||||
|
*/
|
||||||
set_value: function(_value) {
|
set_value: function(_value) {
|
||||||
if(_value == this.options.selected_value) {
|
if(_value == this.options.selected_value ||_value && this.options.selected_value == this.__proto__.attributes.selected_value["default"] &&
|
||||||
|
_value != this.options.unselected_value) {
|
||||||
this.span.text(this.options.ro_true);
|
this.span.text(this.options.ro_true);
|
||||||
this.value = _value;
|
this.value = _value;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user