elkarte/Elkarte — pull request #817 by Spuds (2013-09-13 14:33:06+00:00)
Title: Some Pretty Sparkly Things to reivew

Some may call this bloat, I think its :cool: The bloat part of this is that it uses jQueryUI

The bulk of this change allows for the drag-able sorting of table rows. I've implemented the example in the ability to drag sort the custom profile fields (which today are sorted by alpha), with this change you can add fields and have them appear in any order you want.

The basics are:
1) it adds a new option to createList 'sortable' => true ... this flag will set up the table html properly.
2) You would then specify 'javascript' => ' $().elkSortable({options})' to enable the function. The options are in the js, most important is the sa: for calling the right subaction to be fulfilled by the xmlcontroller.

The way sortable works is that each row has a unique ID, in our case its the primary key of the db row ... when you drag it sends the ajax request via post in 1-n of the rows, the rows have the unique ID, so when you get the request the ID's are in the proper view order.

Adding this functionality to other areas should be pretty straight forward

To test:
add a new column to custom_fields ... call it vieworder set it as smallint
get a copy of jquery-ui-1.10.3.min and place it in your scripts directory. I set it up so only the admin area will call this file, did not want the weight of that file for the regular forum. (will also use the CDN)

The commits from the 11th are just extra fluf .. one changes the down scroll to stop at the content bottom so it does not show the footer ... the other allows for fieldsets to be collapsible for the heck of it.