[*] BO : AdminProducts find smallest images
This commit is contained in:
@@ -291,51 +291,83 @@ class Blocktopmenu extends Module
|
||||
<br/>
|
||||
<a href="#" id="removeItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);"><< '.$this->l('Remove').'</a>
|
||||
</td>
|
||||
<td style="vertical-align:top;padding:5px 15px;">
|
||||
<h4 style="margin-top:5px;">'.$this->l('Change order').':</h4>
|
||||
<a href="#" id="menuOrderUp" class="button" style="font-size:20px;display:block;">↑</a><br/>
|
||||
<a href="#" id="menuOrderDown" class="button" style="font-size:20px;display:block;">↓</a><br/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="clear"> </div>
|
||||
<script type="text/javascript">
|
||||
function add()
|
||||
{
|
||||
$("#availableItems option:selected").each(function(i){
|
||||
var val = $(this).val();
|
||||
var text = $(this).text();
|
||||
text = text.replace(/(^\s*)|(\s*$)/gi,"");
|
||||
if (val == "PRODUCT")
|
||||
{
|
||||
val = prompt("'.$this->l('Set ID product').'");
|
||||
if (val == null || val == "" || isNaN(val))
|
||||
return;
|
||||
text = "'.$this->l('Product ID').' "+val;
|
||||
val = "PRD"+val;
|
||||
}
|
||||
$("#items").append("<option value=\""+val+"\">"+text+"</option>");
|
||||
});
|
||||
serialize();
|
||||
return false;
|
||||
}
|
||||
|
||||
function remove()
|
||||
{
|
||||
$("#items option:selected").each(function(i){
|
||||
$(this).remove();
|
||||
});
|
||||
serialize();
|
||||
return false;
|
||||
}
|
||||
|
||||
function serialize()
|
||||
{
|
||||
var options = "";
|
||||
$("#items option").each(function(i){
|
||||
options += $(this).val() + ",";
|
||||
});
|
||||
$("#itemsInput").val(options.substr(0, options.length - 1));
|
||||
}
|
||||
|
||||
function move(up)
|
||||
{
|
||||
var tomove = $("#items option:selected");
|
||||
if (tomove.length >1)
|
||||
{
|
||||
alert(\''.Tools::htmlentitiesUTF8($this->l('Please select just one item')).'\');
|
||||
return false;
|
||||
}
|
||||
if (up)
|
||||
tomove.prev().insertAfter(tomove);
|
||||
else
|
||||
tomove.next().insertBefore(tomove);
|
||||
serialize();
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#addItem").click(add);
|
||||
$("#availableItems").dblclick(add);
|
||||
$("#removeItem").click(remove);
|
||||
$("#items").dblclick(remove);
|
||||
function add()
|
||||
{
|
||||
$("#availableItems option:selected").each(function(i){
|
||||
var val = $(this).val();
|
||||
var text = $(this).text();
|
||||
text = text.replace(/(^\s*)|(\s*$)/gi,"");
|
||||
if (val == "PRODUCT")
|
||||
{
|
||||
val = prompt("'.$this->l('Set ID product').'");
|
||||
if (val == null || val == "" || isNaN(val))
|
||||
return;
|
||||
text = "'.$this->l('Product ID').' "+val;
|
||||
val = "PRD"+val;
|
||||
}
|
||||
$("#items").append("<option value=\""+val+"\">"+text+"</option>");
|
||||
});
|
||||
serialize();
|
||||
return false;
|
||||
}
|
||||
function remove()
|
||||
{
|
||||
$("#items option:selected").each(function(i){
|
||||
$(this).remove();
|
||||
});
|
||||
serialize();
|
||||
return false;
|
||||
}
|
||||
function serialize()
|
||||
{
|
||||
var options = "";
|
||||
$("#items option").each(function(i){
|
||||
options += $(this).val()+",";
|
||||
});
|
||||
$("#itemsInput").val(options.substr(0, options.length - 1));
|
||||
}
|
||||
$("#menuOrderUp").click(function(e){
|
||||
e.preventDefault();
|
||||
move(true);
|
||||
});
|
||||
$("#menuOrderDown").click(function(e){
|
||||
e.preventDefault();
|
||||
move();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<label for="s">'.$this->l('Search Bar').'</label>
|
||||
|
||||
Reference in New Issue
Block a user