From 69e843950863ea6813ce26f7acd4d139f71a2392 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 7 Nov 2012 10:04:16 +0100 Subject: [PATCH] Init version of DnD. --- .../javascripts/app/controllers/dashboard.js.coffee | 9 +++++++++ app/assets/javascripts/app/views/dashboard.jst.eco | 4 ++-- .../app/views/dashboard/activity_stream.jst.eco | 2 +- .../app/views/dashboard/recent_viewed.jst.eco | 2 +- .../javascripts/app/views/dashboard/rss.jst.eco | 2 +- .../javascripts/app/views/dashboard/ticket.jst.eco | 2 +- app/assets/stylesheets/zzz.css | 13 ++++++++++++- 7 files changed, 27 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/controllers/dashboard.js.coffee b/app/assets/javascripts/app/controllers/dashboard.js.coffee index 6c694bb4b..7d28a23bb 100644 --- a/app/assets/javascripts/app/controllers/dashboard.js.coffee +++ b/app/assets/javascripts/app/controllers/dashboard.js.coffee @@ -80,6 +80,15 @@ class Index extends App.Controller params.el = @el.find( '#' + target ) new plugin.controller( params ) + dndOptions = + placeholder: 'can-move-plcaeholder' + tolerance: 'pointer' + distance: 15 + opacity: 0.6 + forcePlaceholderSize: true + + @el.find( '#sortable' ).sortable( dndOptions ) + @el.find( '#sortable-sidebar' ).sortable( dndOptions ) App.Config.set( '', Index, 'Routes' ) App.Config.set( '/', Index, 'Routes' ) diff --git a/app/assets/javascripts/app/views/dashboard.jst.eco b/app/assets/javascripts/app/views/dashboard.jst.eco index 552417d00..42256e7ed 100644 --- a/app/assets/javascripts/app/views/dashboard.jst.eco +++ b/app/assets/javascripts/app/views/dashboard.jst.eco @@ -13,9 +13,9 @@ --> -
+
-
+
diff --git a/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco b/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco index ee9dbaf53..353caa14f 100644 --- a/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco @@ -1,5 +1,5 @@
-
+

<%- @T( @head ) %>

<% for item in @items: %> diff --git a/app/assets/javascripts/app/views/dashboard/recent_viewed.jst.eco b/app/assets/javascripts/app/views/dashboard/recent_viewed.jst.eco index 74d610f23..b9980a45e 100644 --- a/app/assets/javascripts/app/views/dashboard/recent_viewed.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/recent_viewed.jst.eco @@ -1,5 +1,5 @@
-
+

<%- @T( @head ) %>

    <% for item in @items: %> diff --git a/app/assets/javascripts/app/views/dashboard/rss.jst.eco b/app/assets/javascripts/app/views/dashboard/rss.jst.eco index f5eacb2bd..171869459 100644 --- a/app/assets/javascripts/app/views/dashboard/rss.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/rss.jst.eco @@ -1,5 +1,5 @@
    -
    +

    <%- @T( @head ) %>

      <% for item in @items: %> diff --git a/app/assets/javascripts/app/views/dashboard/ticket.jst.eco b/app/assets/javascripts/app/views/dashboard/ticket.jst.eco index e677dd2ca..62c402d22 100644 --- a/app/assets/javascripts/app/views/dashboard/ticket.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/ticket.jst.eco @@ -1,7 +1,7 @@
      -
      +

      <%- @T( @overview.meta.name ) %>

      diff --git a/app/assets/stylesheets/zzz.css b/app/assets/stylesheets/zzz.css index a1231b262..11ed1b4da 100644 --- a/app/assets/stylesheets/zzz.css +++ b/app/assets/stylesheets/zzz.css @@ -169,7 +169,6 @@ form { } footer { -// margin-top: 17px; padding-top: 17px; border-top: 1px solid #EEE; } @@ -186,6 +185,18 @@ footer { float: right; } +.can-move { + cursor: move; +} + +.can-move-plcaeholder { + border: 1px dashed #DDD; + background: #EEE; + margin-top: 5px; + margin-bottom: 5px; +} + + .ticket-answer .avatar { margin-left: 10px; }