Sha256: b52dd8750fd1ac57fb1e70921816da5efe41d157dd8febd3bf4031e124dfdb1a
Contents?: true
Size: 1.05 KB
Versions: 62
Compression:
Stored size: 1.05 KB
Contents
/** * @namespace WORKAREA.sortNavigationMenus */ WORKAREA.registerModule('navigationMenuSortables', (function () { 'use strict'; var findMenuPositions = function (event) { var result = {}, $menus = $('[data-sort-navigation-menu-id]', event.target); $menus.each(function (index, menu) { var id = $(menu).data('sortNavigationMenuId'); if (id) { result['positions[' + id + ']'] = index; } }); return result; }, saveSort = function (event) { $.post( WORKAREA.routes.admin.moveNavigationMenusPath(), findMenuPositions(event) ); }, /** * @method * @name init * @memberof WORKAREA.sortNavigationMenus */ init = function ($scope) { $('[data-sort-navigation-menu]', $scope).sortable({ stop: saveSort, }); }; return { init: init }; }()));
Version data entries
62 entries across 62 versions & 1 rubygems