Fixed item sorting on mobile
authorAlexander Ebert <ebert@woltlab.com>
Sun, 23 Oct 2016 10:57:08 +0000 (12:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 23 Oct 2016 10:57:08 +0000 (12:57 +0200)
wcfsetup/install/files/acp/templates/adList.tpl
wcfsetup/install/files/acp/templates/menuItemList.tpl
wcfsetup/install/files/acp/templates/noticeList.tpl

index 26b7076b4c84eb51c802b75d086de96d26ecc06e..3f36b0399a3350b2374306977bf009a6af987cd5 100644 (file)
@@ -1,10 +1,17 @@
 {include file='header' pageTitle='wcf.acp.ad.list'}
 
 <script data-relocate="true">
+       require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) {
+               new UiSortableList({
+                       containerId: 'adList',
+                       className: 'wcf\\data\\ad\\AdAction',
+                       offset: {@$startIndex}
+               });
+       });
+       
        $(function() {
                new WCF.Action.Delete('wcf\\data\\ad\\AdAction', '.jsAd');
                new WCF.Action.Toggle('wcf\\data\\ad\\AdAction', '.jsAd');
-               new WCF.Sortable.List('adList', 'wcf\\data\\ad\\AdAction', {@$startIndex});
        });
 </script>
 
@@ -37,6 +44,7 @@
                                                <a href="{link controller='AdEdit' object=$ad}{/link}">{$ad->adName}</a>
                                                
                                                <span class="statusDisplay sortableButtonContainer">
+                                                       <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
                                                        <span class="icon icon16 fa-{if !$ad->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $ad->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$ad->adID}"></span>
                                                        <a href="{link controller='AdEdit' object=$ad}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
                                                        <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$ad->adID}" data-confirm-message-html="{lang __encode=true}wcf.acp.ad.delete.confirmMessage{/lang}"></span>
index 308fe9c1a1b59293d2d3c298e24ad00f01eb9ce4..ab067812471083109e6792d6f8fd35e4de9cbf0d 100644 (file)
@@ -1,10 +1,22 @@
 {include file='header' pageTitle='wcf.acp.menu.item.list'}
 
 <script data-relocate="true">
+       require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) {
+               new UiSortableList({
+                       containerId: 'menuItemList',
+                       className: 'wcf\\data\\menu\\item\\MenuItemAction',
+                       options: {
+                               protectRoot: true
+                       },
+                       additionalParameters: {
+                               menuID: '{@$menuID}'
+                       }
+               });
+       });
+       
        $(function() {
                new WCF.Action.Delete('wcf\\data\\menu\\item\\MenuItemAction', '.sortableNode', '> .sortableNodeLabel .jsDeleteButton');
                new WCF.Action.Toggle('wcf\\data\\menu\\item\\MenuItemAction', '.sortableNode', '> .sortableNodeLabel .jsToggleButton');
-               new WCF.Sortable.List('menuItemList', 'wcf\\data\\menu\\item\\MenuItemAction', undefined, { protectRoot: true }, false, { menuID: '{@$menuID}' });
        });
 </script>
 
@@ -33,6 +45,7 @@
                                                <span class="sortableNodeLabel">
                                                        <a href="{link controller='MenuItemEdit' id=$menuItemNode->itemID}{/link}">{lang}{$menuItemNode->title}{/lang}</a>
                                                        <span class="statusDisplay sortableButtonContainer">
+                                                               <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
                                                                {if $menuItemNode->canDisable()}
                                                                        <span class="icon icon16 fa-{if !$menuItemNode->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $menuItemNode->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$menuItemNode->itemID}"></span>
                                                                {else}
index c37c6f1517dc5149f88ead5040e2eaa85b7b4844..e5f576cc040a7e79fc44ead3c4280dcea64ae061 100644 (file)
@@ -1,10 +1,17 @@
 {include file='header' pageTitle='wcf.acp.notice.list'}
 
 <script data-relocate="true">
+       require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) {
+               new UiSortableList({
+                       containerId: 'noticeList',
+                       className: 'wcf\\data\\notice\\NoticeAction',
+                       offset: {@$startIndex}
+               });
+       });
+       
        $(function() {
                new WCF.Action.Delete('wcf\\data\\notice\\NoticeAction', '.jsNotice');
                new WCF.Action.Toggle('wcf\\data\\notice\\NoticeAction', '.jsNotice');
-               new WCF.Sortable.List('noticeList', 'wcf\\data\\notice\\NoticeAction', {@$startIndex});
        });
 </script>
 
@@ -37,6 +44,7 @@
                                                <a href="{link controller='NoticeEdit' object=$notice}{/link}">{$notice->noticeName}</a>
                                                
                                                <span class="statusDisplay sortableButtonContainer">
+                                                       <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
                                                        <span class="icon icon16 fa-{if $notice->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $notice->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$notice->noticeID}"></span>
                                                        <a href="{link controller='NoticeEdit' object=$notice}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
                                                        <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$notice->noticeID}" data-confirm-message-html="{lang __encode=true}wcf.acp.notice.delete.confirmMessage{/lang}"></span>