Skip to content

Commit

Permalink
refactor(SortableList): update OnUpdate/OnRemove logic (#4034)
Browse files Browse the repository at this point in the history
* refactor: 移除恢复节点逻辑

* chore: 更新依赖包

* doc: 更新资源文件

* chore: bump version 8.0.1

* chore: 更新依赖包
  • Loading branch information
ArgoZhang authored Aug 12, 2024
1 parent 0acee74 commit 3554cc9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="8.0.3" />
<PackageReference Include="BootstrapBlazor.PdfReader" Version="8.0.4" />
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="8.0.2" />
<PackageReference Include="BootstrapBlazor.Sortable" Version="8.0.0" />
<PackageReference Include="BootstrapBlazor.Sortable" Version="8.0.1" />
<PackageReference Include="BootstrapBlazor.Splitting" Version="8.0.0" />
<PackageReference Include="BootstrapBlazor.SvgEditor" Version="8.1.0" />
<PackageReference Include="BootstrapBlazor.SummerNote" Version="8.0.3" />
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6671,8 +6671,8 @@
"SortableListCloneIntro": "Set the <code>SortableListOption</code> parameter <code>Clone</code> to set whether to clone the current element when dragging",
"SortableListDisableSortTitle": "Disable Sort",
"SortableListDisableSortIntro": "By setting the <code>SortableListOption</code> parameter <code>Sort</code> to set whether to sort the current element when dragging",
"SortableListHanlderTitle": "Handler",
"SortableListHanlderIntro": "By setting the <code>SortableListOption</code> parameter <code>Handle</code> to specify the draggable element, the entire element is dragged when the mouse drags the icon",
"SortableListHandlerTitle": "Handler",
"SortableListHandlerIntro": "By setting the <code>SortableListOption</code> parameter <code>Handle</code> to specify the draggable element, the entire element is dragged when the mouse drags the icon",
"SortableListFilterTitle": "Filter",
"SortableListFilterIntro": "By setting the <code>SortableListOption</code> parameter <code>Filter</code> to set conditional drag elements, the red element in the example cannot be dragged",
"SortableListNestTitle": "Nest",
Expand Down
6 changes: 3 additions & 3 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -6671,9 +6671,9 @@
"SortableListCloneTitle": "拖拽时克隆元素",
"SortableListCloneIntro": "通过设置 <code>SortableListOption</code> 参数 <code>Clone</code> 设置拖拽时是否克隆当前元素",
"SortableListDisableSortTitle": "禁止排序",
"SortableListDisableSortIntro": "通过设置 <code>SortableListOption</code> 参数 <code>Sort</code> 设置拖拽时是否排序当前元素",
"SortableListHanlderTitle": "拖拽控制元素",
"SortableListHanlderIntro": "通过设置 <code>SortableListOption</code> 参数 <code>Handle</code> 设置指定可拖拽元素,鼠标拖动图标时拖动整个元素",
"SortableListDisableSortIntro": "通过设置 <code>SortableListOption</code> 参数 <code>Sort</code> 设置拖拽时是否排序当前元素,本例中通过设置 <code>Putback=\"false\"</code> 禁止元素拖拽回左侧集合中",
"SortableListHandlerTitle": "拖拽控制元素",
"SortableListHandlerIntro": "通过设置 <code>SortableListOption</code> 参数 <code>Handle</code> 设置指定可拖拽元素,鼠标拖动图标时拖动整个元素",
"SortableListFilterTitle": "条件过滤拖拽组件",
"SortableListFilterIntro": "通过设置 <code>SortableListOption</code> 参数 <code>Filter</code> 设置有条件性的拖拽元素,示例中红色元素无法拖动",
"SortableListNestTitle": "嵌套使用",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>8.0.0</Version>
<Version>8.0.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,12 @@ const initSortable = (id, element, invoke, op) => {

if (op.triggerUpdate) {
op.onUpdate = event => {
event.item.remove();
event.to.insertBefore(event.item, event.to.childNodes[event.oldIndex]);
invoke.invokeMethodAsync('TriggerUpdate', event.oldIndex, event.newIndex);
}
}

if (op.triggerRemove) {
op.onRemove = event => {
event.item.remove();
event.from.insertBefore(event.item, event.from.childNodes[event.oldIndex]);
invoke.invokeMethodAsync('TriggerRemove', event.oldIndex, event.newIndex);
}
}
Expand Down

0 comments on commit 3554cc9

Please sign in to comment.