Fixed sorting on mobile devices
authorAlexander Ebert <ebert@woltlab.com>
Sat, 8 Oct 2016 11:02:27 +0000 (13:02 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 8 Oct 2016 11:02:27 +0000 (13:02 +0200)
wcfsetup/install/files/acp/templates/smileyList.tpl
wcfsetup/install/files/js/WCF.Poll.js

index c101ad73fb3a6e0a6c49ef78c440a21faa16af83..7d346963a249aa1c06bbed9ca5a4f108fb1bcb26 100644 (file)
@@ -2,9 +2,16 @@
 
 {if $objects|count}
        <script data-relocate="true">
+               require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) {
+                       new UiSortableList({
+                               containerId: 'smileyList',
+                               className: 'wcf\\data\\smiley\\SmileyAction',
+                               offset: {@$startIndex}
+                       });
+               });
+               
                $(function() {
                        new WCF.Action.Delete('wcf\\data\\smiley\\SmileyAction', $('.smileyRow'));
-                       new WCF.Sortable.List('smileyList', 'wcf\\data\\smiley\\SmileyAction', {@$startIndex});
                });
        </script>
 {/if}
@@ -48,6 +55,7 @@
                                                                        <a href="{link controller='SmileyEdit' id=$smiley->smileyID}{/link}">{@$smiley->getHtml()} {lang}{$smiley->smileyTitle}{/lang}</a> <span class="badge">{$smiley->smileyCode}</span>{foreach from=$smiley->getAliases() item='alias'} <span class="badge" style="margin-left: 5px">{$alias}</span>{/foreach}
                                                                        
                                                                        <span class="statusDisplay sortableButtonContainer">
+                                                                               <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
                                                                                <a href="{link controller='SmileyEdit' id=$smiley->smileyID}{/link}"><span title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip icon icon16 fa-pencil"></a>
                                                                                <span title="{lang}wcf.global.button.delete{/lang}" class="jsDeleteButton jsTooltip icon icon16 fa-times" data-object-id="{@$smiley->smileyID}" data-confirm-message-html="{lang __encode=true}wcf.acp.smiley.delete.sure{/lang}">
                                                                                
index b4e354300f182b37ae124032407d2c1793a8aeba..a35006c162962a0a974b5d458b76528596f25dda 100644 (file)
@@ -73,9 +73,14 @@ WCF.Poll.Management = Class.extend({
                }
                
                // init sorting
-               new WCF.Sortable.List(containerID, '', undefined, {
-                       toleranceElement: '> div'
-               }, true);
+               require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) {
+                       new UiSortableList({
+                               containerId: containerID,
+                               options: {
+                                       toleranceElement: '> div'
+                               }
+                       });
+               });
        },
        
        /**
@@ -115,6 +120,7 @@ WCF.Poll.Management = Class.extend({
                
                // insert buttons
                var $container = $('<div class="pollOptionInput" />').appendTo($listItem);
+               $('<span class="icon icon16 fa-arrows sortableNodeHandle" />').appendTo($container);
                $('<span class="icon icon16 fa-plus jsTooltip jsAddOption pointer" title="' + WCF.Language.get('wcf.poll.button.addOption') + '" />').click($.proxy(this._addOption, this)).appendTo($container);
                $('<span class="icon icon16 fa-times jsTooltip jsDeleteOption pointer" title="' + WCF.Language.get('wcf.poll.button.removeOption') + '" />').click($.proxy(this._removeOption, this)).appendTo($container);