Permalink
Browse files

Small fixes.

  • Loading branch information...
1 parent 2a765cd commit ccfbfcd5f23d754dc2e8093a5cdbc3f89cdf8006 Bright 4 committed May 25, 2009
View
27 README
@@ -1,4 +1,4 @@
-= Drag Order v0.3
+= Drag Order v0.3.1
Created by Bright 4, February 2009. Inspired by and based on Sean Cribbs' Reorder extension.
@@ -10,7 +10,19 @@ The drag-and-drop style was inspired by the way OS-X implements this in various
== Installation
-1) Unpack/checkout/export the extension into vendor/extensions of your project.
+You can either use the automated radiant extension install, or install manually.
+
+=== Using Radiant extension install
+
+1) Install the extension using (from your project's root dir):
+ script/extension install drag_order
+
+2) Restart the server and you're ready to drag-and-drop pages.
+
+
+=== Manual install
+
+1) Unpack/checkout/export the extension into {project root}/vendor/extensions/drag_order (note the underscore here).
2) Run the extension migrations (replace {environment} by the target environment, e.g. production).
$ rake {environment} radiant:extensions:drag_order:migrate
@@ -19,7 +31,6 @@ The drag-and-drop style was inspired by the way OS-X implements this in various
$ rake {environment} radiant:extensions:drag_order:update
4) Restart the server and you're ready to drag-and-drop pages.
- To bypass the ordering system simply supply a "by" option to the finder tags.
== Usage
@@ -32,6 +43,8 @@ The drag-and-drop style was inspired by the way OS-X implements this in various
- The plugin automatically adds 'copy' and, when necessary, a number to the title, slug and breadcrumb when multiple copies are made.
- If the page has been dragged to the correct location, release the mouse cursor. The admin page will reload with the page at its new position.
+To bypass the ordering system simply supply a "by" option to the finder tags.
+
== Notes
@@ -42,6 +55,12 @@ The drag-and-drop style was inspired by the way OS-X implements this in various
== Version History
+# v0.3.1 - 25-05-2009
+- FIX: if the move request takes some time to finish, the dragline now stays put when dropped instead of still being dragged along with the mouse.
+- Changed color of the row that is being dragged to fit better with default Radiant colors.
+- Small robustness-fix for cases when the rake migrate is forgotten.
+- Modified install instructions in README.
+
# v0.3 - 16-03-2009
- Incorporated copy functionality. When pressing Ctrl or Command, you can copy the item.
- Fixed errors which occurred when trying to place two pages with the same slugs. Now, the second one is seen as a copy.
@@ -57,4 +76,4 @@ The drag-and-drop style was inspired by the way OS-X implements this in various
- Fixed JS bug that did not allow dragging of child pages which were loaded using AJAX after expanding a page.
# v0.2 - 21-02-2009
-- Initial commit
+- Initial commit
View
@@ -2,7 +2,7 @@
require_dependency 'application'
class DragOrderExtension < Radiant::Extension
- version "0.3"
+ version "0.3.1"
description "This extension allows pages to be moved or copied to any arbitrary (valid)
place in the document tree structure by dragging the page to its new position and
dropping it there. Created by Bright 4, February 2009. Inspired by and based on Sean
@@ -26,7 +26,7 @@ def move_to
@rel.reload
if @loc != 2
# Make room for the page
- @new_siblings = Page.find_all_by_parent_id( @rel.parent.id, :conditions => [ "position >= " + (@rel.position + @loc).to_s ] )
+ @new_siblings = Page.find_all_by_parent_id( @rel.parent.id, :conditions => [ "position >= " + (@rel.position.to_i + @loc).to_s ] )
@new_siblings.each do |s|
if s.id != @page.id || @copy
s.position += 1
@@ -47,7 +47,7 @@ def move_to
old_parent = @page.parent
if @loc != 2
@page.parent = @rel.parent
- @page.position = @rel.position + (@loc == 1 ? 1 : -1)
+ @page.position = @rel.position.to_i + (@loc == 1 ? 1 : -1)
else
@page.parent = @rel
@page.position = 1
@@ -101,4 +101,4 @@ def move_to
request.env["HTTP_REFERER"] ? redirect_to(:back) : redirect_to(admin_page_url)
end
-end
+end
@@ -166,10 +166,10 @@ var DragOrder = Class.create({
if (this.expandObj.timer) clearTimeout(this.expandObj.timer);
this.expandObj = null;
if (this.dragLine) this.dragLine.hide();
+ }
- Event.stopObserving(document.body, 'mousemove', this.moveBind);
- Event.stopObserving(document.body, 'mouseup', this.stopBind);
- }
+ Event.stopObserving(document.body, 'mousemove', this.moveBind);
+ Event.stopObserving(document.body, 'mouseup', this.stopBind);
},
cancelEvent: function(evt) {
@@ -2,7 +2,7 @@
cursor: move;
}
#content table.index tr.dragging {
- background-color: #647481;
+ background-color: #D3ECF4;
}
#content table.index tr.dragging td {
color: white;
@@ -35,4 +35,4 @@ div#drag_line div.copy {
* html div#drag_line div.copy {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/admin/drag_order_copy.png', sizingMethod='scale');
-}
+}

0 comments on commit ccfbfcd

Please sign in to comment.