AutorÃa | Ultima modificación | Ver Log |
{{!This file is part of Moodle - https://moodle.org/Moodle is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.Moodle is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with Moodle. If not, see <http://www.gnu.org/licenses/>.}}{{!@template question_ordering/proxyhtmlThe user actually drags a proxy object, which is constructed from this template.The proxy node is then added directly as a child of <body>. Your CSS also needs to ensurethat this proxy has position: absolute.Classes required for JS:* noneData attributes required for JS:* noneContext variables required for this template:* listClassName The token is replaced with the class attribute of the list being dragged.* itemClassName The token is replaced with the class attribute of the item being dragged.Because of this, the styling of the contents of your list item needs to work for the proxy,as well as for items in place in the context of the list* itemHtml The token is replaced with the innerHtml of the item being dragged.* proxyStyles Passed in styles detailing the size of the proxy, and its position relative to the mouse.Example context (json):{"listClassName": "osep-list","itemClassName": "osep-item osep-itemmoving","itemHtml": "Item 1","proxyStyles": "left: 0px; top: 0px; width: 100px; height: 100px;"}}}<div class="que ordering dragproxy" style="position: absolute; {{proxyStyles}}"><ul class="{{listClassName}}"><li class="{{itemClassName}} item-moving">{{{itemHtml}}}</li></ul></div>