import { DatabaseObjectActionResponse } from "../../../Ajax/Data";
function deleteObject(data: DatabaseObjectActionResponse, objectElement: HTMLElement): void {
+ const childContainer = objectElement.querySelector(".jsObjectActionObjectChildren");
+ if (childContainer) {
+ Array.from(childContainer.children).forEach((child: HTMLElement) => {
+ objectElement.parentNode!.insertBefore(child, objectElement);
+ });
+ }
+
objectElement.remove();
}
}
});
});
-
- $(function() {
- var deleteAction = new WCF.Action.Delete('wcf\\data\\menu\\item\\MenuItemAction', '.sortableNode', '> .sortableNodeLabel .jsDeleteButton');
- var mpTriggerEffect = deleteAction.triggerEffect;
- deleteAction.triggerEffect = function (objectIDs) {
- // move children up by one
- objectIDs.forEach(function (objectId) {
- var item = elBySel('#menuItemList li[data-object-id="' + objectId + '"]');
- elBySelAll('.sortableList[data-object-id="' + objectId + '"] > li', item, function(childItem) {
- item.parentNode.insertBefore(childItem, item);
- });
- });
-
- mpTriggerEffect.call(deleteAction, objectIDs);
- };
- });
</script>
<header class="contentHeader">
{/if}
<a href="{link controller='MenuItemEdit' id=$menuItemNode->itemID}{/link}" class="jsTooltip" title="{lang}wcf.global.button.edit{/lang}"><span class="icon icon16 fa-pencil"></span></a>
{if $menuItemNode->canDelete()}
- <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$menuItemNode->itemID}" data-confirm-message-html="{lang __encode=true}wcf.acp.menu.item.delete.confirmMessage{/lang}"></span>
+ {objectAction action="delete" objectTitle=$menuItemNode->getTitle()}
{else}
<span class="icon icon16 fa-times disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
{/if}
</span>
</span>
- <ol class="sortableList" data-object-id="{@$menuItemNode->itemID}">{if !$menuItemNode->hasChildren()}</ol></li>{/if}
+ <ol class="sortableList jsObjectActionObjectChildren" data-object-id="{@$menuItemNode->itemID}">{if !$menuItemNode->hasChildren()}</ol></li>{/if}
{if !$menuItemNode->hasChildren() && $menuItemNode->isLastSibling()}
{@"</ol></li>"|str_repeat:$menuItemNode->getOpenParentNodes()}
exports.setup = void 0;
Handler_1 = tslib_1.__importDefault(Handler_1);
function deleteObject(data, objectElement) {
+ const childContainer = objectElement.querySelector(".jsObjectActionObjectChildren");
+ if (childContainer) {
+ Array.from(childContainer.children).forEach((child) => {
+ objectElement.parentNode.insertBefore(child, objectElement);
+ });
+ }
objectElement.remove();
}
function setup() {
<item name="wcf.acp.menu.list"><![CDATA[Menüs]]></item>
<item name="wcf.acp.menu.item.add"><![CDATA[Menüpunkt hinzufügen]]></item>
<item name="wcf.acp.menu.item.action.description"><![CDATA[Menü: {$menu->getTitle()}]]></item>
- <item name="wcf.acp.menu.item.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} den Menüpunkt <span class="confirmationObject">{$menuItemNode->getTitle()}</span> wirklich löschen?]]></item>
<item name="wcf.acp.menu.item.edit"><![CDATA[Menüpunkt bearbeiten]]></item>
<item name="wcf.acp.menu.item.externalURL"><![CDATA[Externe URL]]></item>
<item name="wcf.acp.menu.item.isDisabled"><![CDATA[Menüpunkt deaktivieren]]></item>
<item name="wcf.acp.menu.list"><![CDATA[Menus]]></item>
<item name="wcf.acp.menu.item.add"><![CDATA[Add Menu Item]]></item>
<item name="wcf.acp.menu.item.action.description"><![CDATA[Menu: {$menu->getTitle()}]]></item>
- <item name="wcf.acp.menu.item.delete.confirmMessage"><![CDATA[Do you really want to delete the menu item <span class="confirmationObject">{$menuItemNode->getTitle()}</span>?]]></item>
<item name="wcf.acp.menu.item.edit"><![CDATA[Edit Menu Item]]></item>
<item name="wcf.acp.menu.item.externalURL"><![CDATA[External URL]]></item>
<item name="wcf.acp.menu.item.isDisabled"><![CDATA[Disable menu item]]></item>