mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
- LSformElement_select_object : Pour une meilleur compatibilité (IE), le
tableau pour l'ajout rapide d'une valeur est créé directement dans le template.
This commit is contained in:
parent
0306515800
commit
2216eb03e3
3 changed files with 38 additions and 24 deletions
|
@ -40,15 +40,15 @@ img.LSformElement_select_object_deleteBtn {
|
||||||
/* LSformElement_select_object_searchAdd */
|
/* LSformElement_select_object_searchAdd */
|
||||||
input.LSformElement_select_object_searchAdd {
|
input.LSformElement_select_object_searchAdd {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
width: 134px;
|
width: 140px !important;
|
||||||
background-image: url(../../images/default/find.png);
|
background: #fff url(../../images/default/find.png) !important;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat !important;
|
||||||
padding-left: 18px;
|
padding-left: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.LSformElement_select_object_searchAdd {
|
ul.LSformElement_select_object_searchAdd {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
width: 152px;
|
width: 138px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: 0.1em;
|
margin-top: 0.1em;
|
||||||
max-height: 10em;
|
max-height: 10em;
|
||||||
|
|
|
@ -162,6 +162,16 @@ var LSformElement_select_object_field = new Class({
|
||||||
|
|
||||||
addLi: function(name,dn) {
|
addLi: function(name,dn) {
|
||||||
if (this.params.multiple) { // Multiple
|
if (this.params.multiple) { // Multiple
|
||||||
|
var current = 0;
|
||||||
|
this.ul.getElements("input[type=hidden]").each(function(input){
|
||||||
|
if ((input.value==dn)&&(input.name != this.name+'[]')) {
|
||||||
|
current=input;
|
||||||
|
}
|
||||||
|
},this);
|
||||||
|
if (current) {
|
||||||
|
this.toggleDeleteLi(current.getParent());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
var li = new Element('li');
|
var li = new Element('li');
|
||||||
li.addClass('LSformElement_select_object');
|
li.addClass('LSformElement_select_object');
|
||||||
|
|
||||||
|
@ -249,6 +259,10 @@ var LSformElement_select_object_field = new Class({
|
||||||
|
|
||||||
onDeleteBtnClick: function(img) {
|
onDeleteBtnClick: function(img) {
|
||||||
var li = img.getParent();
|
var li = img.getParent();
|
||||||
|
this.toggleDeleteLi(li);
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleDeleteLi: function(li) {
|
||||||
var a = li.getFirst('a');
|
var a = li.getFirst('a');
|
||||||
var input = li.getFirst('input');
|
var input = li.getFirst('input');
|
||||||
if (input.value!="") {
|
if (input.value!="") {
|
||||||
|
@ -267,23 +281,12 @@ var LSformElement_select_object_field = new Class({
|
||||||
if (this._searchAddOpen==0) {
|
if (this._searchAddOpen==0) {
|
||||||
this._searchAddOpen = 1;
|
this._searchAddOpen = 1;
|
||||||
if (!$type(this.searchAddInput)) {
|
if (!$type(this.searchAddInput)) {
|
||||||
this.table = new Element('table');
|
this.tr = this.ul.getParent().getParent();
|
||||||
this.table.addClass('LSformElement_select_object_searchAdd');
|
|
||||||
this.tr = new Element('tr');
|
|
||||||
this.tr.addClass('LSformElement_select_object_searchAdd');
|
|
||||||
this.tr.injectInside(this.table);
|
|
||||||
this.td = new Element('td');
|
|
||||||
this.td.addClass('LSformElement_select_object_searchAdd');
|
|
||||||
this.td.injectInside(this.tr);
|
|
||||||
|
|
||||||
this.td2 = new Element('td');
|
this.td2 = new Element('td');
|
||||||
this.td2.addClass('LSformElement_select_object_searchAdd');
|
this.td2.addClass('LSformElement_select_object_searchAdd');
|
||||||
this.td2.injectInside(this.tr);
|
this.td2.injectInside(this.tr);
|
||||||
|
|
||||||
|
|
||||||
this.ul.injectInside(this.td);
|
|
||||||
this.table.injectInside(this.dd);
|
|
||||||
|
|
||||||
this.searchAddInput = new Element('input');
|
this.searchAddInput = new Element('input');
|
||||||
this.searchAddInput.addClass('LSformElement_select_object_searchAdd');
|
this.searchAddInput.addClass('LSformElement_select_object_searchAdd');
|
||||||
this.searchAddInput.addEvent('keydown',this.onKeyUpSearchAddInput.bindWithEvent(this));
|
this.searchAddInput.addEvent('keydown',this.onKeyUpSearchAddInput.bindWithEvent(this));
|
||||||
|
@ -352,7 +355,7 @@ var LSformElement_select_object_field = new Class({
|
||||||
addSearchAddLi: function(name,dn) {
|
addSearchAddLi: function(name,dn) {
|
||||||
var current = 0;
|
var current = 0;
|
||||||
this.ul.getElements("input[type=hidden]").each(function(input){
|
this.ul.getElements("input[type=hidden]").each(function(input){
|
||||||
if (input.value==dn) {
|
if ((input.value==dn)&&(input.name == this.name+'[]')) {
|
||||||
current=1;
|
current=1;
|
||||||
}
|
}
|
||||||
},this);
|
},this);
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
{if !$freeze}
|
||||||
|
<table class='LSformElement_select_object_searchAdd'>
|
||||||
|
<tr class='LSformElement_select_object_searchAdd'>
|
||||||
|
<td class='LSformElement_select_object_searchAdd'>
|
||||||
|
{/if}
|
||||||
<ul class='LSform LSformElement_select_object' id='{$attr_name}'>
|
<ul class='LSform LSformElement_select_object' id='{$attr_name}'>
|
||||||
{foreach from=$values item=txt key=dn}
|
{foreach from=$values item=txt key=dn}
|
||||||
<li>{include file=$fieldTemplate}</li>
|
<li>{include file=$fieldTemplate}</li>
|
||||||
|
@ -5,3 +10,9 @@
|
||||||
<li>{include file=$fieldTemplate}</li>
|
<li>{include file=$fieldTemplate}</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
|
{if !$freeze}
|
||||||
|
</td>
|
||||||
|
<td class='LSformElement_select_object_searchAdd'></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
{/if}
|
||||||
|
|
Loading…
Reference in a new issue