| Revision 3880:e6d1f6d9d7df,
547 bytes
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
|
Use let and const rather than var (ES2015/ES6), use template string where is more efficient
|
| Line | |
|---|
| 1 | /*global $ */ |
|---|
| 2 | 'use strict'; |
|---|
| 3 | |
|---|
| 4 | $(function() { |
|---|
| 5 | $('#my-favs ul').sortable({ |
|---|
| 6 | 'cursor': 'move' |
|---|
| 7 | }); |
|---|
| 8 | $('#my-favs ul, #my-favs ul *').css({ |
|---|
| 9 | 'cursor': 'move' |
|---|
| 10 | }); |
|---|
| 11 | $('#my-favs ul input').css({ |
|---|
| 12 | 'cursor': 'auto' |
|---|
| 13 | }); |
|---|
| 14 | $('#favs-form').submit(function() { |
|---|
| 15 | let order = []; |
|---|
| 16 | $('#my-favs ul li input.position').each(function() { |
|---|
| 17 | order.push(this.name.replace(/^order\[([^\]]+)\]$/, '$1')); |
|---|
| 18 | }); |
|---|
| 19 | $('input[name=favs_order]')[0].value = order.join(','); |
|---|
| 20 | return true; |
|---|
| 21 | }); |
|---|
| 22 | $('#my-favs ul li input.position').hide(); |
|---|
| 23 | }); |
|---|
Note: See
TracBrowser
for help on using the repository browser.