mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +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 */
|
||||
input.LSformElement_select_object_searchAdd {
|
||||
border: 1px solid #ccc;
|
||||
width: 134px;
|
||||
background-image: url(../../images/default/find.png);
|
||||
background-repeat: no-repeat;
|
||||
width: 140px !important;
|
||||
background: #fff url(../../images/default/find.png) !important;
|
||||
background-repeat: no-repeat !important;
|
||||
padding-left: 18px;
|
||||
}
|
||||
|
||||
ul.LSformElement_select_object_searchAdd {
|
||||
border: 1px solid #ccc;
|
||||
width: 152px;
|
||||
width: 138px;
|
||||
margin: 0;
|
||||
margin-top: 0.1em;
|
||||
max-height: 10em;
|
||||
|
|
|
@ -162,6 +162,16 @@ var LSformElement_select_object_field = new Class({
|
|||
|
||||
addLi: function(name,dn) {
|
||||
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');
|
||||
li.addClass('LSformElement_select_object');
|
||||
|
||||
|
@ -249,6 +259,10 @@ var LSformElement_select_object_field = new Class({
|
|||
|
||||
onDeleteBtnClick: function(img) {
|
||||
var li = img.getParent();
|
||||
this.toggleDeleteLi(li);
|
||||
},
|
||||
|
||||
toggleDeleteLi: function(li) {
|
||||
var a = li.getFirst('a');
|
||||
var input = li.getFirst('input');
|
||||
if (input.value!="") {
|
||||
|
@ -267,23 +281,12 @@ var LSformElement_select_object_field = new Class({
|
|||
if (this._searchAddOpen==0) {
|
||||
this._searchAddOpen = 1;
|
||||
if (!$type(this.searchAddInput)) {
|
||||
this.table = new Element('table');
|
||||
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.tr = this.ul.getParent().getParent();
|
||||
|
||||
this.td2 = new Element('td');
|
||||
this.td2.addClass('LSformElement_select_object_searchAdd');
|
||||
this.td2.injectInside(this.tr);
|
||||
|
||||
|
||||
this.ul.injectInside(this.td);
|
||||
this.table.injectInside(this.dd);
|
||||
|
||||
this.searchAddInput = new Element('input');
|
||||
this.searchAddInput.addClass('LSformElement_select_object_searchAdd');
|
||||
this.searchAddInput.addEvent('keydown',this.onKeyUpSearchAddInput.bindWithEvent(this));
|
||||
|
@ -352,7 +355,7 @@ var LSformElement_select_object_field = new Class({
|
|||
addSearchAddLi: function(name,dn) {
|
||||
var current = 0;
|
||||
this.ul.getElements("input[type=hidden]").each(function(input){
|
||||
if (input.value==dn) {
|
||||
if ((input.value==dn)&&(input.name == this.name+'[]')) {
|
||||
current=1;
|
||||
}
|
||||
},this);
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
<ul class='LSform LSformElement_select_object' id='{$attr_name}'>
|
||||
{foreach from=$values item=txt key=dn}
|
||||
<li>{include file=$fieldTemplate}</li>
|
||||
{foreachelse}
|
||||
<li>{include file=$fieldTemplate}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{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}'>
|
||||
{foreach from=$values item=txt key=dn}
|
||||
<li>{include file=$fieldTemplate}</li>
|
||||
{foreachelse}
|
||||
<li>{include file=$fieldTemplate}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{if !$freeze}
|
||||
</td>
|
||||
<td class='LSformElement_select_object_searchAdd'></td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue