Dotclear

source: plugins/simpleMenu/js/simplemenu.js @ 3709:c88e69474c34

Revision 3709:c88e69474c34, 767 bytes checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

use strict and no more linter warnings/errors as far as possible, switch from inline js to separate loaded file

Line 
1/*global $, dotclear */
2'use strict';
3
4$(function() {
5  $('#menuitemslist').sortable({
6    'cursor': 'move'
7  });
8  $('#menuitemslist tr').hover(function() {
9    $(this).css({
10      'cursor': 'move'
11    });
12  }, function() {
13    $(this).css({
14      'cursor': 'auto'
15    });
16  });
17  $('#menuitems').submit(function() {
18    var order = [];
19    $('#menuitemslist tr td input.position').each(function() {
20      order.push(this.name.replace(/^order\[([^\]]+)\]$/, '$1'));
21    });
22    $('input[name=im_order]')[0].value = order.join(',');
23    return true;
24  });
25  $('#menuitemslist tr td input.position').hide();
26  $('#menuitemslist tr td.handle').addClass('handler');
27  dotclear.condSubmit('#menuitems tr td input[name^=items_selected]', '#menuitems #remove-action');
28});
Note: See TracBrowser for help on using the repository browser.

Sites map