Fix bug.
This commit is contained in:
parent
7616e05258
commit
d6a749995f
|
@ -88,27 +88,6 @@
|
||||||
$('#backend_fields_analysis').css( 'border','');
|
$('#backend_fields_analysis').css( 'border','');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$( ".table tbody td" ).each(function(i,v){
|
|
||||||
$(v).attr("index",$(v).index());
|
|
||||||
$(v).html("<span class=\"brand ui-sortable-handle\"><i class=\"icons-list-2\"></i></span>" + $(v).html());
|
|
||||||
})
|
|
||||||
$( ".table tbody >" ).sortable({
|
|
||||||
axis: "x",
|
|
||||||
revert: true,
|
|
||||||
handle: ".brand",
|
|
||||||
update: function(event, ui) {
|
|
||||||
var new_index = ui.item.index();
|
|
||||||
var old_index = ui.item.attr("index");
|
|
||||||
var indices = [new_index,old_index].sort();
|
|
||||||
for(var new_i=indices[0];new_i<=indices[1];new_i++){
|
|
||||||
var td = ui.item.parent().find(">").eq(new_i);
|
|
||||||
var old_i =td.attr("index");
|
|
||||||
var org_i = td.data("index");
|
|
||||||
td.attr("index",new_i);
|
|
||||||
td.find('.fields_order_hidden_input').val(new_i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$( ".sort_asc_fields, .sort_desc_fields" ).on("click", function(){
|
$( ".sort_asc_fields, .sort_desc_fields" ).on("click", function(){
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
if(_this.prop('checked')){
|
if(_this.prop('checked')){
|
||||||
|
@ -117,4 +96,25 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
$( ".table tbody td" ).each(function(i,v){
|
||||||
|
$(v).attr("index",$(v).index());
|
||||||
|
$(v).html("<span class=\"brand ui-sortable-handle\"><i class=\"icons-list-2\"></i></span>" + $(v).html());
|
||||||
|
})
|
||||||
|
$( ".table tbody >" ).sortable({
|
||||||
|
axis: "x",
|
||||||
|
revert: true,
|
||||||
|
handle: ".brand",
|
||||||
|
update: function(event, ui) {
|
||||||
|
var new_index = ui.item.index();
|
||||||
|
var old_index = ui.item.attr("index");
|
||||||
|
var indices = [new_index,old_index].sort();
|
||||||
|
for(var new_i=indices[0];new_i<=indices[1];new_i++){
|
||||||
|
var td = ui.item.parent().find(">").eq(new_i);
|
||||||
|
var old_i =td.attr("index");
|
||||||
|
var org_i = td.data("index");
|
||||||
|
td.attr("index",new_i);
|
||||||
|
td.find('.fields_order_hidden_input').val(new_i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
|
@ -24,7 +24,7 @@ $( ".selectbox" ).ready(function() {
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-hover table-striped plugin_templates-index dt-responsive nowrap">
|
<table class="table table-hover table-striped plugin_templates-index dt-responsive nowrap">
|
||||||
<caption><h3>{{widget-title}}</h3></caption>
|
<caption style="display: none;"><h3>{{widget-title}}</h3></caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr data-level="0" data-list="headers">
|
<tr data-level="0" data-list="headers">
|
||||||
<th class="col-md-{{col}}">{{head-title}}</th>
|
<th class="col-md-{{col}}">{{head-title}}</th>
|
||||||
|
|
Loading…
Reference in New Issue