[19712] | 1 | /* |
---|
| 2 | * This file is part of EC-CUBE |
---|
| 3 | * |
---|
[21867] | 4 | * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. |
---|
[19712] | 5 | * |
---|
| 6 | * http://www.lockon.co.jp/ |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 21 | */ |
---|
| 22 | (function($){ |
---|
| 23 | var updateUpDown = function(sortable){ |
---|
| 24 | $('div:not(.ui-sortable-helper)', sortable) |
---|
| 25 | .removeClass('first') |
---|
| 26 | .filter(':first').addClass('first').end() |
---|
| 27 | .children('input.target-id').val(sortable.id).end() |
---|
| 28 | .each(function(){ |
---|
| 29 | var top = $(this).prevAll().length + 1; |
---|
| 30 | $(this).children('input.top').val(top); |
---|
| 31 | }); |
---|
| 32 | }; |
---|
[20540] | 33 | |
---|
[19712] | 34 | var sortableUpdate = function(e, ui){ |
---|
| 35 | updateUpDown(this); |
---|
| 36 | if(ui.sender) |
---|
| 37 | updateUpDown(ui.sender[0]); |
---|
| 38 | }; |
---|
[20540] | 39 | |
---|
[19712] | 40 | $(document).ready(function(){ |
---|
| 41 | var els = ['#MainHead', '#MainFoot', '#LeftNavi', '#RightNavi', '#TopNavi', '#BottomNavi', '#HeadNavi', '#HeaderTopNavi', '#FooterBottomNavi', '#HeaderInternalNavi', '#Unused']; |
---|
| 42 | var $els = $(els.toString()); |
---|
[20540] | 43 | |
---|
[19712] | 44 | $els.each(function(){ |
---|
| 45 | updateUpDown(this); |
---|
| 46 | }); |
---|
[20540] | 47 | |
---|
[19712] | 48 | $els.sortable({ |
---|
| 49 | items: '> div', |
---|
| 50 | //handle: 'dt', |
---|
| 51 | cursor: 'move', |
---|
| 52 | //cursorAt: { top: 2, left: 2 }, |
---|
| 53 | //opacity: 0.8, |
---|
| 54 | //helper: 'clone', |
---|
| 55 | appendTo: 'body', |
---|
| 56 | placeholder: 'clone', |
---|
| 57 | placeholder: 'placeholder', |
---|
| 58 | connectWith: els, |
---|
| 59 | start: function(e,ui) { |
---|
| 60 | ui.helper.css("width", ui.item.width()); |
---|
| 61 | }, |
---|
| 62 | //change: sortableChange, |
---|
| 63 | update: sortableUpdate |
---|
| 64 | }); |
---|
| 65 | }); |
---|
[20540] | 66 | |
---|
[19712] | 67 | $(window).bind('load',function(){ |
---|
| 68 | setTimeout(function(){ |
---|
| 69 | $('#overlay').fadeOut(function(){ |
---|
| 70 | $('body').css('overflow', 'auto'); |
---|
| 71 | }); |
---|
| 72 | }, 750); |
---|
| 73 | }); |
---|
| 74 | })(jQuery); |
---|