Commit b7abc4a9 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #75198 fix treeSelect js compatibilty with jquery 3

parent 4b5b5fd1
- ticket #75198 : Administration : correction du composant de sélection de domaines ou de paniers dans les écrans de configurations.
\ No newline at end of file
......@@ -243,15 +243,8 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action {
public function domainesPaniersJsonAction() {
$this->_helper->viewRenderer->setNoRender();
$data = [];
$data[] = $this->_user->getPaniersJson();
$data[] = (new Class_Catalogue())->getDomainesJson();
$data[] = (new Class_PanierNotice())->getPaniersAdminsNotInCatalogueJson();
$JSON = json_encode($data);
$this->getResponse()->setHeader('Content-Type', 'application/json; charset=utf-8');
$this->getResponse()->setBody($JSON);
$this->_helper->json([$this->_user->getPaniersJson(),
(new Class_Catalogue())->getDomainesJson(),
(new Class_PanierNotice())->getPaniersAdminsNotInCatalogueJson()]);
}
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ class ZendAfi_Form_Element_DomainePanier extends ZendAfi_Form_Element_TreeSelect
public function __construct($spec, $options = null) {
$options = array_merge(['UrlDataSource' => Class_Url::assemble(['module' => 'admin',
'controller' => 'catalogue',
'action' => 'domaines-paniers']).'.json',
'action' => 'domaines-paniers-json']),
'MultipleSelection' => false,
'InputIdCategoriesName' => 'id_catalogue',
'InputIdItemsName' => 'id_panier',
......
......@@ -9,12 +9,18 @@
vertical-align: top;
}
.ui-treeselect-items-tree,
.ui-treeselect-items-tree {
overflow-y: scroll;
}
.ui-treeselect-selected-items {
max-height: 300px;
overflow-y: auto;
}
.ui-treeselect-items-tree ,
.ui-treeselect-selected-items {
max-height: 400px;
}
.ui-treeselect-items-tree {
width: 65%;
......
......@@ -296,12 +296,15 @@
_deselect: function(li) {
this._findConnectedIn(li, this.selectedItems).
hide('fast', function(){
$(this).remove()});
li.children('input').removeAttr('checked');
li.find("li input").removeAttr('disabled');
this.
_findConnectedIn(li, this.selectedItems).
hide('fast', function()
{
$(this).remove();
});
li.closest('ul').find('li input').prop('checked', false);
li.children('input').prop('checked', false);
li.find("li input").prop('disabled', false);
li.children('a').removeClass('ui-state-active');
},
......@@ -335,7 +338,7 @@
if (!this.multiple_selection)
this._deselectAll();
li.children('input').attr('checked', 'checked');
li.children('input').prop('checked', true);
var selectedLI = $("<li>"+
"<a href='#'>"+
......@@ -388,12 +391,12 @@
if(!this.multiple_selection)
return false;
li.find("li>input").each(
li.find(" ul li > input").each(
function(index, checkbox) {
self._deselect($(checkbox).parent());
$(checkbox).
attr('disabled', true).
removeAttr('checked'); });
prop('disabled', true).
prop('checked', false); });
},
......@@ -534,7 +537,7 @@
itemsNotSelectable: function() {
this.itemsTree.find('li.ui-treeselect-item>input:first-child').remove();
this.itemsTree.find('li.ui-treeselect-item').attr('style', 'padding-left: 25px');
this.itemsTree.find('li.ui-treeselect-item').prop('style', 'padding-left: 25px');
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment