openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 50eb7a08b39b05ac6de208d7e23ddba9acf9a707
parent a42077f78e8f67901aa89c655752c601fc72a5c5
Author: Jan Dankert <devnull@localhost>
Date:   Mon,  7 Nov 2011 21:23:14 +0100

Drag'n'drop für Views.

Diffstat:
themes/default/css/layout.css | 9+++++++++
themes/default/js/openrat.js | 11+++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/themes/default/css/layout.css b/themes/default/css/layout.css @@ -795,6 +795,15 @@ body > div { display:none; } /* T a b s */ +.drophover +{ + border:2px dotted green; +} +.dropactive +{ + border:1px dotted blue; +} + div.window div.menu > div.icons { float:right; diff --git a/themes/default/js/openrat.js b/themes/default/js/openrat.js @@ -66,6 +66,14 @@ function refreshWorkbench() $(this).addClass('active'); loadView( p.find('div.filler'),createUrl(action,method,id)); }); + + // Drag n Drop für Views + $('ul.views > li.action').draggable( {cursor:'move',revert: 'invalid' }); + $('ul.views').droppable( {accept:'li.action',hoverClass: 'drophover',activeClass: 'dropactive',drop: function(event, ui) { + var dropped = ui.draggable; + var droppedOn = $(this); + $(dropped).detach().css({top: 0,left: 0}).appendTo(droppedOn).click(); + } } ); }); //alert('go'); @@ -276,6 +284,9 @@ function loadBranch(li,type,id) $(this).addClass('selected'); setNewAction( line.action, line.id ); }); + + // Drag and drop für die Baum-Inhalte. + //$(new_li).children('div.entry').draggable( {cursor:'move',revert: 'invalid' }); } });