Skip to content

Commit

Permalink
Further improvement to the list sortings... encapsulated the helper f…
Browse files Browse the repository at this point in the history
…unction.
  • Loading branch information
raulriera authored and Russ Johnson committed Apr 23, 2010
1 parent efa11d5 commit ec169ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 7 additions & 0 deletions javascripts/application.js
@@ -0,0 +1,7 @@
// Return a helper with preserved width of cells
var fixHelper = function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
};
2 changes: 1 addition & 1 deletion views/layout.cfm
Expand Up @@ -10,7 +10,7 @@

<cfoutput>
#stylesheetLinkTag("base, jquery.treeTable.css, themes/blue/style.css, splash/jquery-ui-1.7.2.custom.css")#
#javascriptIncludeTag("jquery.treeTable.min.js")#
#javascriptIncludeTag("jquery.treeTable.min.js,application")#
</cfoutput>

<cfif params.controller is "pages" and (params.action is "new" or params.action is "edit")>
Expand Down
10 changes: 1 addition & 9 deletions views/layouts/index.cfm
Expand Up @@ -24,15 +24,7 @@
<p>#linkTo(text="<span class='new-layout'>New Layout</span>", route="new_layout_path", class="button_wide")#</p>
</cfoutput>

<script type="text/javascript">
// Return a helper with preserved width of cells
var fixHelper = function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
};
<script type="text/javascript">
$(".table tbody").sortable({
helper: fixHelper,
update: function(event, ui) {
Expand Down

0 comments on commit ec169ec

Please sign in to comment.