Skip to content

Commit 6f4a124

Browse files
committed
Fixing sortable dataobjects when using click to toggle
At the moment, ClickToToggle being enabled breaks the drag and drop reordoring due to some JS assumptions being made. I've moved the class set on the ul up to the parent to solve this problem
1 parent dc6dd62 commit 6f4a124

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

templates/DataObjectManager.ss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<% if Can(add) %>
55
<a class="popup-button" rel="$PopupWidth" href="$AddLink" alt="add">
66
<span class="uploadlink"><img src="dataobject_manager/images/add.png" alt="" /><% sprintf(_t('DataObjectManager.ADDITEM','Add %s',PR_MEDIUM,'Add [name]'),$AddTitle) %></span>
7-
</a>
7+
</a>
88
<% else %>
99
<h3>$PluralTitle</h3>
1010
<% end_if %>
@@ -39,8 +39,8 @@
3939
</div>
4040
</div>
4141
<div class="list column{$Headings.Count}" class="list-holder" style="width:100%;">
42-
<div class="dataobject-list">
43-
<ul class="<% if ShowAll %>sortable-{$sourceClass}<% end_if %><% if ClickToToggle %> toggleSelect<% end_if %>">
42+
<div class="dataobject-list<% if ClickToToggle %> toggleSelect<% end_if %>">
43+
<ul class="<% if ShowAll %>sortable-{$sourceClass}<% end_if %>">
4444
<li class="head">
4545
<div class="fields-wrap">
4646
<% control Headings %>
@@ -87,13 +87,10 @@
8787
<div class="bottom-controls">
8888
<div class="rounded_table_bottom_right">
8989
<div class="rounded_table_bottom_left">
90-
<% if Sortable %>
91-
<div class="sort-control">
90+
<div class="sort-control">
91+
<% if Sortable %>
9292
<input id="showall-{$id}" type="checkbox" <% if ShowAll %>checked="checked"<% end_if %> value="<% if Paginated %>$ShowAllLink<% else %>$PaginatedLink<% end_if %>" /><label for="showall-{$id}"><% _t('DataObjectManager.DRAGDROP','Allow drag &amp; drop reordering') %></label>
93-
</div>
94-
<% end_if %>
95-
<div class="dataobjectmanager-button">
96-
<a href="$ExportLink"><% sprintf(_t('DataObjectManager.EXPORT','Export %s'),$PluralTitle) %></span></a>
93+
<% end_if %>
9794
</div>
9895
<div class="per-page-control">
9996
<% if ShowAll %><% else %>$PerPageDropdown<% end_if %>

templates/RelationDataObjectManager.ss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
</div>
4040
</div>
4141
<div class="list column{$Headings.Count}" class="list-holder" style="width:100%;">
42-
<div class="dataobject-list">
43-
<ul class="<% if ShowAll %>sortable-{$SortableClass}<% end_if %><% if ClickToToggle %> toggleSelect<% end_if %>">
42+
<div class="dataobject-list<% if ClickToToggle %> toggleSelect<% end_if %>">
43+
<ul class="<% if ShowAll %>sortable-{$SortableClass}<% end_if %>">
4444
<li class="head">
4545
<div class="fields-wrap">
4646
<% control Headings %>
@@ -100,13 +100,13 @@
100100
<input id="only-related-{$id}" type="checkbox" <% if OnlyRelated %>checked="checked"<% end_if %> value="<% if OnlyRelated %>$AllRecordsLink<% else %>$OnlyRelatedLink<% end_if %>" /><label for="only-related-{$id}"><% _t('DataObjectManager.ONLYRELATED','Show only related records') %></label>
101101
</div>
102102
<% end_if %>
103-
<% end_if %>
103+
<% end_if %>
104104
<div class="per-page-control">
105105
<% if ShowAll %><% else %>$PerPageDropdown<% end_if %>
106106
</div>
107107
</div>
108108
</div>
109109
</div>
110110
</div>
111-
$ExtraData
111+
$ExtraData
112112
</div>

0 commit comments

Comments
 (0)