Skip to content

Commit 760119f

Browse files
author
unclecheese
committed
Merge pull request #58 from dhensby/master
fixing sortable DOs when ClickToToggle is enabled
2 parents ba710b6 + 6f4a124 commit 760119f

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

javascript/dataobject_manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ $.fn.DataObjectManager.init = function(obj) {
172172
// Click function for the LI
173173
$container.find('ul:not(.ui-sortable) li.data').unbind('click').click(function(e) {
174174
var $this = $(this);
175-
if ($this.parent().hasClass('toggleSelect')) {
175+
if ($this.parent().parent().hasClass('toggleSelect')) {
176176
var $input = $this.find('input'),
177177
checker = !$input.attr('checked');
178178
//don't ask me wtf is going on here!

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)