Refonte et mise en place du minibrowser
This commit is contained in:
mespeche
2013-08-30 16:32:01 +02:00
parent 64698b1d3d
commit fe859591f4
2 changed files with 68 additions and 79 deletions

View File

@@ -1,6 +1,6 @@
(function($, window, document){
$(function($){
$(function(){
// -- Init datepicker --
if($('.date').length){
@@ -43,14 +43,8 @@
});
}
});
}(window.jQuery, window, document));
// -- Mini browser --
function miniBrowser(root, url){
miniBrowser = function (root, url){
$.getJSON(url, {
root: root
@@ -64,8 +58,7 @@ function miniBrowser(root, url){
$('<span />').html(' > '),
$('<a />').attr('href', '#').html(v.display).click(function(e){
e.preventDefault();
miniBrowser(v.url)
miniBrowser(v.url);
})
);
});
@@ -76,8 +69,7 @@ function miniBrowser(root, url){
$('<p />').append(
$('<a />').attr('href', '#').html(v.titre).click(function(e){
e.preventDefault();
miniBrowser(v.id)
miniBrowser(v.id);
})
)
);
@@ -105,12 +97,15 @@ function miniBrowser(root, url){
);
});
$('#fastBrowser_breadcrumb').unbind().empty().append(breadcrumb);
$('#fastBrowser_categories').unbind().empty().append(categories);
$('#fastBrowser_products').unbind().empty().append(products);
$('#minibrowser-breadcrumb').unbind().empty().append(breadcrumb);
$('#minibrowser-categories').unbind().empty().append(categories);
})
.fail(function() {
console.log('The JSON file cant be read');
});
}
});
}(window.jQuery, window, document));

View File

@@ -201,7 +201,7 @@
</select>
</div>
<div class="control-group">
<div class="control-group span6">
<label for="operator">Operator :</label>
<div class="controls">
<select name="operator" id="operator">
@@ -244,21 +244,15 @@
</select>
<input type="text" name="value" class="input-mini">
<table class="table-bordered">
<table class="table table-bordered">
<tr>
<td colspan="2" id="fastBrowser_breadcrumb"></td>
<td id="minibrowser-breadcrumb"></td>
</tr>
<tr>
<th class="span6">
<?php echo trad('categories_list', 'admin'); ?>
</th>
<th class="span6">
<?php echo trad('products_list', 'admin'); ?>
</th>
<th><span class="icon-th-list"></span> Categories list</th>
</tr>
<tr>
<td id="fastBrowser_categories"></td>
<td id="fastBrowser_products"></td>
<td id="minibrowser-categories"></td>
</tr>
</table>