mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Implement option "disabled" for picker fields (#6498)
This commit is contained in:
parent
02a436d159
commit
86c83556e5
@ -13,6 +13,7 @@ HumHub Changelog
|
|||||||
- Enh #68: Online Indicator Position
|
- Enh #68: Online Indicator Position
|
||||||
- Fix #6492: Fix module form "Set as default"
|
- Fix #6492: Fix module form "Set as default"
|
||||||
- Fix #6457: Regression with membership cache. Also move cache to `Membership::findMembership`.
|
- Fix #6457: Regression with membership cache. Also move cache to `Membership::findMembership`.
|
||||||
|
- Enh #6498: Implement option "disabled" for picker fields
|
||||||
|
|
||||||
1.15.0-beta.1 (July 31, 2023)
|
1.15.0-beta.1 (July 31, 2023)
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace humhub\modules\ui\form\widgets;
|
namespace humhub\modules\ui\form\widgets;
|
||||||
|
|
||||||
use humhub\components\ActiveRecord;
|
|
||||||
use Yii;
|
use Yii;
|
||||||
use yii\base\Model;
|
|
||||||
use yii\db\ActiveQuery;
|
use yii\db\ActiveQuery;
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
use yii\helpers\Url;
|
use yii\helpers\Url;
|
||||||
@ -48,9 +46,16 @@ abstract class BasePicker extends JsInputWidget
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Disabled items
|
* Disabled items
|
||||||
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $disabledItems;
|
public $disabledItems;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables the picker field
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
public $disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default route used for search queries.
|
* Default route used for search queries.
|
||||||
* This can be overwritten by defining the $url.
|
* This can be overwritten by defining the $url.
|
||||||
@ -415,7 +420,8 @@ abstract class BasePicker extends JsInputWidget
|
|||||||
'load-more' => Yii::t('UserModule.chooser', 'Load more'),
|
'load-more' => Yii::t('UserModule.chooser', 'Load more'),
|
||||||
'input-too-short' => Yii::t('UserModule.chooser', 'Please enter at least {n} character', ['n' => $this->minInput]),
|
'input-too-short' => Yii::t('UserModule.chooser', 'Please enter at least {n} character', ['n' => $this->minInput]),
|
||||||
'input-too-long' => Yii::t('UserModule.chooser', 'You reached the maximum number of allowed characters ({n}).', ['n' => $this->maxInput]),
|
'input-too-long' => Yii::t('UserModule.chooser', 'You reached the maximum number of allowed characters ({n}).', ['n' => $this->maxInput]),
|
||||||
'default-results' => $this->getDefaultResultData()
|
'default-results' => $this->getDefaultResultData(),
|
||||||
|
'disabled' => $this->disabled
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!empty($this->disabledItems)) {
|
if (!empty($this->disabledItems)) {
|
||||||
|
@ -278,10 +278,12 @@
|
|||||||
cursor: @cursor-disabled;
|
cursor: @cursor-disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-selection,
|
.select2-selection {
|
||||||
.select2-selection--multiple .select2-selection__choice {
|
|
||||||
background-color: @input-bg-disabled;
|
background-color: @input-bg-disabled;
|
||||||
}
|
}
|
||||||
|
.select2-selection--multiple .select2-selection__choice {
|
||||||
|
background-color: @btn-link-disabled-color;
|
||||||
|
}
|
||||||
|
|
||||||
.select2-selection__clear,
|
.select2-selection__clear,
|
||||||
.select2-selection--multiple .select2-selection__choice__remove {
|
.select2-selection--multiple .select2-selection__choice__remove {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user