Skip to content

Commit

Permalink
alter fielID, direction and add vars extras
Browse files Browse the repository at this point in the history
  • Loading branch information
tigo-di committed Jul 2, 2014
1 parent 4633c3a commit 04f1d0c
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions assets/order_entries.publish.js
Expand Up @@ -9,10 +9,46 @@
Symphony.Extensions.OrderEntries = function() {
var table, fieldId, direction, oldSorting, newSorting;

// vars extras
var obj_field_order_entries, id_field_order_entries, href_order_base, href_order;

var init = function() {

table = Symphony.Elements.contents.find('table');
fieldId = table.attr('data-order-entries-id');
direction = table.attr('data-order-entries-direction');



// fieldId = table.attr('data-order-entries-id');

obj_field_order_entries = $('[class="field-order_entries"]');

id_field_order_entries = obj_field_order_entries.attr('id');

fieldId = id_field_order_entries.replace("field-","");



// direction = table.attr('data-order-entries-direction');

href_order_base = obj_field_order_entries.find('a').attr('href');

href_order = href_order_base.replace( /\?sort=\d*&order=/, "" );

direction = href_order;


if ( direction == 'asc' ) {

direction = 'desc';

}
else
{

direction = 'asc';

}


// Add help
Symphony.Elements.breadcrumbs.append('<p class="inactive"><span>– ' + Symphony.Language.get('drag to reorder') + '</span></p>');
Expand Down

0 comments on commit 04f1d0c

Please sign in to comment.