mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
Implement dragndrop to edit sitemaps (still working)
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8723 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c00dd923b8
commit
f94ab07b93
3 changed files with 104 additions and 28 deletions
72
modules/admin/tpl/js/sitemap.js
Normal file
72
modules/admin/tpl/js/sitemap.js
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/* NHN (developers@xpressengine.com) */
|
||||
jQuery(function($){
|
||||
|
||||
$('form.siteMap')
|
||||
.find('li')
|
||||
.prepend('<button type="button" class="moveTo">Move to</button>')
|
||||
.append('<span class="vr"></span><span class="hr"></span>')
|
||||
.mouseover(function(){
|
||||
$(this).addClass('active');
|
||||
return false;
|
||||
})
|
||||
.mouseout(function(){
|
||||
$(this).removeClass('active');
|
||||
return false;
|
||||
})
|
||||
.mousedown(function(event){
|
||||
var $this, $clone, $target = $(event.target), $uls, $ghost, $last;
|
||||
|
||||
if($target.is('a,input:text,textarea')) return;
|
||||
|
||||
$this = $(this);
|
||||
$clone = $this.clone(true).find('.side,input').remove().end();
|
||||
$uls = $this.parentsUntil('form.siteMap').filter('ul');
|
||||
|
||||
$ghost = $last = $('<ul class="lined" />');
|
||||
for(var i=1,c=$uls.length; i < c; i++) {
|
||||
$last = $last.append('<li><ul /></li>').find('>ul');
|
||||
}
|
||||
|
||||
$last.append($clone);
|
||||
$ghost
|
||||
.css({
|
||||
backgroundColor : '#fff',
|
||||
position : 'absolute',
|
||||
opacity : .5
|
||||
});
|
||||
|
||||
return false;
|
||||
})
|
||||
.find('input:text')
|
||||
.each(function(i,input){
|
||||
var $this = $(this), id='sitemap-id-'+i;
|
||||
|
||||
$this
|
||||
.attr('id', id)
|
||||
.css({width:0,opacity:0,overflow:'hidden'})
|
||||
.before('<label />')
|
||||
.prev('label')
|
||||
.attr('for', id)
|
||||
.text($this.val());
|
||||
})
|
||||
.end()
|
||||
.end()
|
||||
|
||||
$('<div id="dropzone-marker" />')
|
||||
.css({display:'none',position:'absolute',backgroundColor:'#000',opacity:0.7})
|
||||
.appendTo('body');
|
||||
|
||||
/*
|
||||
$('.tgMap').click(function(){
|
||||
var t = $(this);
|
||||
t.parent('.siteMap').toggleClass('fold');
|
||||
if(t.parent('.siteMap').hasClass('fold')){
|
||||
t.text('펼치기').next('.lined').slideUp(200).next('.btnArea').hide();
|
||||
} else {
|
||||
t.text('접기').next('.lined').slideDown(200).next('.btnArea').show();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
*/
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue