[Proto-Scripty] Sortable with addtional droppable
Yes, I'm still using prototype :) I have a list of thumbnails in a container, and a Sortable created for the container so I can reorder them. I also want to add a separate droppable outside the container div to accept imgs I want to trash. I can't figure out how to get the thumb to drop onto the trash outside of the thumb container. With the code below, the image won't drop until it's release over the original thumbs div. Anyone have any pointers? HTML (erb): div id=thumbs % @thumbs.each do |thumb| % img class=crop_img id=thumb_%=thumb.id% src=%=thumb.filename% / % end % /div div id=crop_trash style=display: block; width:100px;height:100px;background-color:#CC Trash /div script type=text/javascript //![CDATA[ Sortable.new_create('thumbs', { format:/_(\d*)$/, onUpdate: function(){ new Ajax.Request('/the/url', {asynchronous: true, evalScripts: true}); }, only: 'crop_img', constraint: false, containment: ['thumbs','crop_trash'], tag: 'img' }); Droppables.add('crop_trash', { accept: 'crop_img', onDrop: function(drag){ thumb_handler.delete_thumb(drag.id.substring(drag.id.lastIndexOf('_')+1)); } } ); //]] /script -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/fjhDNghhEtkJ. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Sortable Dragging Items in a list
I have a list that I have added a sortable on when I drag a item to the end of the list the positon or offset in the list moves back up the list so I can never drag an item to the last item in the list. If I have ghosting on as I drag the item to the bottom of the list the ghosted image moves up the screen. I can see the y offset or delta change as I move up and down the list so the ghosted image move away or toward my cursor as I move it. Any help would be appreciated. function alignPositionValues() { var idx=1; $('fieldslist').select('li').each(function(listItem) { listItem.down('input[type=hidden]').writeAttribute('value',1*idx); idx = idx + 1; }); Cookie.set('fieldsscroller', $('fieldsscroller').scrollTop, {path: '/'}); $(button-refresh).click(); } Event.observe(window,blur,function() { $('fieldsscroller').scrollTop = (Cookie.get('fieldsscroller') || 0); }); Event.observe(window,load,function() { $('fieldsscroller').scrollTop = (Cookie.get('fieldsscroller') || 0); tsjsSyncTableWidths('fieldslist', 'fieldshdr'); Position.includeScrollOffsets = true; Sortable.create('fieldslist', { onUpdate: alignPositionValues, constraint: 'vertical', overlap: 'vertical', ghosting: true, scroll: 'fieldsscroller' }); }); div id=fieldsscroller class=listbackground verticalscroller leftborder bottomborder rightborder style=position:relative; height: 600px; top:0px; left:0px; overflow-x:auto; div style=width:100%; height:100% ul id=fieldslist style=list-style-type:none; padding:0px;margin: 5px WEBOBJECT NAME=DisplayFieldsRepetition WEBOBJECT NAME=FieldItem/WEBOBJECT /WEBOBJECT /ul /div Grant Hickey -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Sortable list bug.
I have a script that creates sortable lists on the fly embedded in a cakephp helper. I'm running across an issue when creating a second sortable list. Everything works perfectly on the first call to 'Sortable.create()', and everything works perfectly on the second call as well.. except: When trying to actually move an item in the second list (with or without a handle) The item will not move until the mouse cursor is about 100-150px below the list item so if my pointer is approximately 1.5 inch underneath the item it moves up and down like normal, and saves the list accordingly. Just curious if anyone had any information involving this.. Thanks ahead of time for your help. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable list bug.
On Jul 25, 2011, at 12:10 PM, Andrew Senner wrote: I have a script that creates sortable lists on the fly embedded in a cakephp helper. I'm running across an issue when creating a second sortable list. Everything works perfectly on the first call to 'Sortable.create()', and everything works perfectly on the second call as well.. except: When trying to actually move an item in the second list (with or without a handle) The item will not move until the mouse cursor is about 100-150px below the list item so if my pointer is approximately 1.5 inch underneath the item it moves up and down like normal, and saves the list accordingly. Just curious if anyone had any information involving this.. Thanks ahead of time for your help. Check to see if your HTML is valid, and also check to see if either of these items is absolutely positioned. It sounds as though the browser is confused about where these elements are. Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable with 1,000 elements?
On 30 June 2011 17:33, Walter Lee Davis wa...@wdstudio.com wrote: On Jun 30, 2011, at 12:08 PM, Richard Quadling wrote: I use http://www.kryogenix.org/code/browser/sorttable/ -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea Thanks, that's completely a different thing from what I'm doing. I have a drag-to-sort widget that lets users put photos in a specific order, then saves that order in an Ajax callback. Scripty.Sortable does precisely that. Walter Aha! Ok. Sorry for the noise. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Sortable with 1,000 elements?
I have been chasing my tail on a slow script error, and just now discovered that if I disable my call to make a 1,000 element list sortable the problem goes entirely away. First, is there any sort of tool I can use to determine where this function is spending all of its time? Second, is there any way to get around these slow script errors? The issue I am seeing is that once the page loads, and this function is called, the browser goes into beachball mode, eventually shows an alert about the slow script. If I okay that (keep trying, I tell it) the page loads and works perfectly. Sortable does exactly what it's supposed to do, and very snappily. Thanks in advance, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable with 1,000 elements?
Walter, I had the timeout problem on a script with a different purpose. What I did was hijacked the code here: http://www.mcfedries.com/JavaScript/timer.asp I created an array: var funcTimers[] and then modified the above code to insert into the array and each func started the timer on entry and ended it on exit. At the end, I dumped the funcTimers out with an alert() and I had my answer. Also, about 10 years ago (when I was younger and smarter) I wrote a table sort function that would sort a standard html table based on the column clicked. It was quite fast and would sort through 1000 columns pretty quickly. I looked on my backup drive and couldnt find it but if you want, I'll root around and post it might give you a different strategy. P~ On Thu, Jun 30, 2011 at 9:01 AM, Walter Lee Davis wa...@wdstudio.comwrote: I have been chasing my tail on a slow script error, and just now discovered that if I disable my call to make a 1,000 element list sortable the problem goes entirely away. First, is there any sort of tool I can use to determine where this function is spending all of its time? Second, is there any way to get around these slow script errors? The issue I am seeing is that once the page loads, and this function is called, the browser goes into beachball mode, eventually shows an alert about the slow script. If I okay that (keep trying, I tell it) the page loads and works perfectly. Sortable does exactly what it's supposed to do, and very snappily. Thanks in advance, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable with 1,000 elements?
Thanks very much for the offer. I seem to have fixed it here, but the problem wasn't specifically in Sortable. What I ended up doing was staggering some of the Ajax loading events that were also happening while that function fired using setTimeout and that got around the problem. Somewhere on one of my computers I have a copy of a framework called light sortable or lite sortable, which aims to ape the Scriptaculous API without being so heavy. It eschews the fancy animation effects for simple fast drag sorting. But my page (and client) are pretty wedded to that eye candy, so I guess Im stuck with that. Thanks, Walter On Jun 30, 2011, at 10:23 AM, Phil Petree wrote: Walter, I had the timeout problem on a script with a different purpose. What I did was hijacked the code here: http://www.mcfedries.com/JavaScript/timer.asp I created an array: var funcTimers[] and then modified the above code to insert into the array and each func started the timer on entry and ended it on exit. At the end, I dumped the funcTimers out with an alert() and I had my answer. Also, about 10 years ago (when I was younger and smarter) I wrote a table sort function that would sort a standard html table based on the column clicked. It was quite fast and would sort through 1000 columns pretty quickly. I looked on my backup drive and couldnt find it but if you want, I'll root around and post it might give you a different strategy. P~ On Thu, Jun 30, 2011 at 9:01 AM, Walter Lee Davis wa...@wdstudio.com wrote: I have been chasing my tail on a slow script error, and just now discovered that if I disable my call to make a 1,000 element list sortable the problem goes entirely away. First, is there any sort of tool I can use to determine where this function is spending all of its time? Second, is there any way to get around these slow script errors? The issue I am seeing is that once the page loads, and this function is called, the browser goes into beachball mode, eventually shows an alert about the slow script. If I okay that (keep trying, I tell it) the page loads and works perfectly. Sortable does exactly what it's supposed to do, and very snappily. Thanks in advance, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable with 1,000 elements?
On 30 June 2011 15:41, Walter Lee Davis wa...@wdstudio.com wrote: Thanks very much for the offer. I seem to have fixed it here, but the problem wasn't specifically in Sortable. What I ended up doing was staggering some of the Ajax loading events that were also happening while that function fired using setTimeout and that got around the problem. Somewhere on one of my computers I have a copy of a framework called light sortable or lite sortable, which aims to ape the Scriptaculous API without being so heavy. It eschews the fancy animation effects for simple fast drag sorting. But my page (and client) are pretty wedded to that eye candy, so I guess Im stuck with that. Thanks, Walter On Jun 30, 2011, at 10:23 AM, Phil Petree wrote: Walter, I had the timeout problem on a script with a different purpose. What I did was hijacked the code here: http://www.mcfedries.com/JavaScript/timer.asp I created an array: var funcTimers[] and then modified the above code to insert into the array and each func started the timer on entry and ended it on exit. At the end, I dumped the funcTimers out with an alert() and I had my answer. Also, about 10 years ago (when I was younger and smarter) I wrote a table sort function that would sort a standard html table based on the column clicked. It was quite fast and would sort through 1000 columns pretty quickly. I looked on my backup drive and couldnt find it but if you want, I'll root around and post it might give you a different strategy. P~ On Thu, Jun 30, 2011 at 9:01 AM, Walter Lee Davis wa...@wdstudio.com wrote: I have been chasing my tail on a slow script error, and just now discovered that if I disable my call to make a 1,000 element list sortable the problem goes entirely away. First, is there any sort of tool I can use to determine where this function is spending all of its time? Second, is there any way to get around these slow script errors? The issue I am seeing is that once the page loads, and this function is called, the browser goes into beachball mode, eventually shows an alert about the slow script. If I okay that (keep trying, I tell it) the page loads and works perfectly. Sortable does exactly what it's supposed to do, and very snappily. Thanks in advance, Walter I use http://www.kryogenix.org/code/browser/sorttable/ -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable with 1,000 elements?
Ah yes.. the stacked ajax calls... kill ya every time! Glad you got it working! On Thu, Jun 30, 2011 at 10:41 AM, Walter Lee Davis wa...@wdstudio.comwrote: Thanks very much for the offer. I seem to have fixed it here, but the problem wasn't specifically in Sortable. What I ended up doing was staggering some of the Ajax loading events that were also happening while that function fired using setTimeout and that got around the problem. Somewhere on one of my computers I have a copy of a framework called light sortable or lite sortable, which aims to ape the Scriptaculous API without being so heavy. It eschews the fancy animation effects for simple fast drag sorting. But my page (and client) are pretty wedded to that eye candy, so I guess Im stuck with that. Thanks, Walter On Jun 30, 2011, at 10:23 AM, Phil Petree wrote: Walter, I had the timeout problem on a script with a different purpose. What I did was hijacked the code here: http://www.mcfedries.com/** JavaScript/timer.asp http://www.mcfedries.com/JavaScript/timer.asp I created an array: var funcTimers[] and then modified the above code to insert into the array and each func started the timer on entry and ended it on exit. At the end, I dumped the funcTimers out with an alert() and I had my answer. Also, about 10 years ago (when I was younger and smarter) I wrote a table sort function that would sort a standard html table based on the column clicked. It was quite fast and would sort through 1000 columns pretty quickly. I looked on my backup drive and couldnt find it but if you want, I'll root around and post it might give you a different strategy. P~ On Thu, Jun 30, 2011 at 9:01 AM, Walter Lee Davis wa...@wdstudio.com wrote: I have been chasing my tail on a slow script error, and just now discovered that if I disable my call to make a 1,000 element list sortable the problem goes entirely away. First, is there any sort of tool I can use to determine where this function is spending all of its time? Second, is there any way to get around these slow script errors? The issue I am seeing is that once the page loads, and this function is called, the browser goes into beachball mode, eventually shows an alert about the slow script. If I okay that (keep trying, I tell it) the page loads and works perfectly. Sortable does exactly what it's supposed to do, and very snappily. Thanks in advance, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable with 1,000 elements?
On Jun 30, 2011, at 12:08 PM, Richard Quadling wrote: I use http://www.kryogenix.org/code/browser/sorttable/ -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea Thanks, that's completely a different thing from what I'm doing. I have a drag-to-sort widget that lets users put photos in a specific order, then saves that order in an Ajax callback. Scripty.Sortable does precisely that. Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Sortable : dropOnEmpty and only options problem
Hi all, i'll try to be as clear as possible... i'm creating a kind of schedule application, with all days of the week divided into half days (AM and PM). Users will be able to drag and drop activities (from a list of activities) to the schedule. Some activities take half a day, others take a full day. So for each day in the schedule, you can have zero, one or two activities. I've created 8 sortable objects : - 1 for the list of activities (called activities_1) - 1 for each day (called day_x, with x as the number of the day : 1 to 7) When i drop a half-day activity in a day_x, i want to limit the next possible drop to day_x to a half-day activity, so i use the only option with the class half-day. When i drop a full-day activity in a day_x, i want to forbid any drop to day_x, so i use the dropOnEmpty option set to false. I set these options by creating a new sortable object day_x each time an update is made (using onUpdate event : the previous sortable object day_x is supposed to be destroyed with the new sortable.create). My problem : dropping a full-day activity to day_x is still possible if an hald-day as already been dropped. It seems that the only option doesn't work when dropOnEmpty is set to true if the droppable zone is not empty. Any idea ? Thanks !!! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Sortable issue in IE
I have a page with thumbnail images that need to be sortable. In all browsers but IE this works great. In IE when i drag an item, the items do not shift to allow dropping. If I remove float:left; from the css it works but then my divs are not inline. (if i set display:inline; my divs will not keep their margin) I know there is a better way to do this. I just haven't figured it out. Here is my code: style type=text/css .photoBox{ background:#fff; border:solid 1px #d8dfea; float:left; height:150px; margin:10px; text-align:center; width:150px; } /style div id=container div id=box_1 class=photoBox[img]/div div id=box_2 class=photoBox[img]/div div id=box_3 class=photoBox[img]/div /div script type=text/javascript Event.observe(window, 'load', function() { Sortable.create('container', { tag: 'div', overlap: 'horizontal', constraint: false, starteffect: function() { }, endeffect: function() { } }); }); /script -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Sortable: can I reject a drag?
so this is my situation: I am making an online link/file directory application where library items are in library folders. I can have nested folders so basically I'm working with a tree. ie: folder -item -folder --item -item etc... Using Sortable.create I managed to make everything sortable and its all dandy and good BUT.. I need to be able to reject certain things... mainly on the top level of the library there can't be any items, just folders... I can reorder those folders but the main node can't have items... how would i accomplish this via scriptaculous? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Sortable: can I reject a drag?
there is an accept flag you can set in the setup .. consult the documentation its in there somewhere.. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: boson...@gmail.com instructi...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, January 27, 2010 4:11 PM Subject: [Proto-Scripty] Sortable: can I reject a drag? so this is my situation: I am making an online link/file directory application where library items are in library folders. I can have nested folders so basically I'm working with a tree. ie: folder -item -folder --item -item etc... Using Sortable.create I managed to make everything sortable and its all dandy and good BUT.. I need to be able to reject certain things... mainly on the top level of the library there can't be any items, just folders... I can reorder those folders but the main node can't have items... how would i accomplish this via scriptaculous? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] sortable
Hi Maybe this is a simple task, or maybe it is an impossible one, I dont know. But here it goes: Assume you have div id=containerDiv div id=div_1img src=arrow.gif a href=page.htmlpage/a/ div div id=div_1img src=arrow.gif a href=page.htmlpage/a/ div div id=div_1img src=arrow.gif a href=page.htmlpage/a/ div /div I want the img tag to be the only draggable element. So when you are with the mouse over the image, it will be possibile to drag. But then ALL THE DIV should be dragged. Is that clear? I dont know how to do this. If I add the option tag: img to Sortable, it doesnt help. I then tried also to give the images an id, like img_1, img_2 and so on. Is this possible to solve? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] sortable
in draggable there is a parameter handle witch if i recall correctly takes a classname... SO add a classname to each image of the same name (img class=drag-me ... / img class=drag-me / ) In your draggable code new Draggable('containerDiv),{ handle:'.drag-me' // other options }); // untested but i dont see why not Alex Mcauley http://www.thevacancymarket.com - Original Message - From: wonderpix wonder...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, December 19, 2009 1:17 AM Subject: [Proto-Scripty] sortable Hi Maybe this is a simple task, or maybe it is an impossible one, I dont know. But here it goes: Assume you have div id=containerDiv div id=div_1img src=arrow.gif a href=page.htmlpage/a/ div div id=div_1img src=arrow.gif a href=page.htmlpage/a/ div div id=div_1img src=arrow.gif a href=page.htmlpage/a/ div /div I want the img tag to be the only draggable element. So when you are with the mouse over the image, it will be possibile to drag. But then ALL THE DIV should be dragged. Is that clear? I dont know how to do this. If I add the option tag: img to Sortable, it doesnt help. I then tried also to give the images an id, like img_1, img_2 and so on. Is this possible to solve? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] sortable
Exactly right, except you don't need to put the dot in front of the classname. handle:'drag-me' Walter On Dec 19, 2009, at 8:08 AM, Alex McAuley wrote: in draggable there is a parameter handle witch if i recall correctly takes a classname... SO add a classname to each image of the same name (img class=drag- me ... / img class=drag-me / ) In your draggable code new Draggable('containerDiv),{ handle:'.drag-me' // other options }); // untested but i dont see why not -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] sortable nonsense...
Hi everyone, I hope there is a solution to this problem. I don't quite get why it is happening in the first place. http://collinatorstudios.com/tree_test.html If you go to the 2nd row (the scrollable div) and scroll far to the right, and then attempt to swap the positions of two boxes, when you release the box that you were dragging, it goes and flies off the screen to the left and moves to some position way way way back (not where it was intended to be placed). Can anyone give me some advice on how to fix this? -patrick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable onUpdate firing at the wrong time
Why is the onUpdate callback fired right when the Sortable is created and not when I move an li? This code also screws up my dropping - I am forced to click again to drop. Additionally, after dragging an li, it remains translucent even after dropping it. Sortable.create( 'lineup', { overlap: 'horizontal', constraint: 'horizontal', onUpdate: alert('onUpdate') } ); ul id=lineup li class=source id=playlistItem_0one/li li class=source id=playlistItem_1two/li /ul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable lists don't drag smoothly with newer versions of scriptaculous
Hi there, I have a sortable UL list using scriptaculous, nothing fancy or unusual. When I use an older version of the dragdrop.js file (e.g. v1.5), it works as expected. The dragging of list elements to sort them, is smooth. When I use the latest version and try to drag a list element, it's jerky and feels delayed. There is a ticket for a similar problem (with links to demo pages): https://prototype.lighthouseapp.com/projects/8887/tickets/168-sortable-trees-are-not-working-well-in-the-current-version However this ticket is referring to sortable trees (nested lists), so the fixed posted isn't applicable (I tried it anyway, just in case!) If anyone has any suggestions or fixes it would be greatly appreciated! Cheers, Emily --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable is undefined
Hi. I just downloaded 1.8.2 and was attempting to use Sortable. I think I have it right, but I get the error Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/ 4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Timestamp: Tue, 7 Jul 2009 06:17:17 UTC Message: 'Sortable' is undefined Line: 26 Char: 2 Code: 0 URI: http://www.ig.utexas.edu/pubs/draggable.js That line is Sortable.create(obj); The odd thing is that I get this message with my js files are included as such... script type=text/javascript src=js/prototype.js/script script type=text/javascript src=js/scriptaculous.js/script , but if I include the scriptaculous files as script type=text/javascript src=http://script.aculo.us/ prototype.js/script script type=text/javascript src=http://script.aculo.us/ scriptaculous.js/script then the script runs correctly. Thoughts? Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable onUpdate vars
How can I get the element id of a Sortable after I drop in a LI from another Sortable? I got the dragging element id with onUpdate:function(list){ alert(list.down().id); } but how can I get the ID of where it is dropped Any help on this would be awesome --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable lists
So I've got a sortable list. Now what I want to do is to have ability to drop items on it. Like: being able to drop other items from other lists. Here's to create a sortable list: Sortable.create(tasksList, {tag:li}); So how can I drop other elements into it? Thanks, Yan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable is undefined
Hi, For the below script, I am getting the error Sortable is undefined, html HEAD titleABCD/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / script language=javascript src=scripts/prototype.js type=text/ javascript /script script language=javascript src=scripts/scriptaculous.js type=text/javascript /script link href=theme/default.css rel=stylesheet type=text/css / style ul.testlist { list-style-type:none; margin:0; padding:0; } ul.testlist li { width:200px; font:12px Verdana; padding:4px; cursor:move; } ul.testlist li.over { background-color:#fcb; } /style /HEAD body div style=position:relative;left:100px;top:-5px; ul id=testlist class=testlist li id=item_1One/li li id=item_2Two/li li id=item_3Three/li /ul /div div id=test2 /div script type=text/javascript language=javascript // ![CDATA[ Sortable.create('testlist', { onUpdate: function() { $('test2').innerHTML= Sortable.sequence ('testlist');} }); // ]] /script /BODY /html All the js files are included properly. The most interesting thing is that it works as an independent HTML file but fails with the above error when I ran it on my server as a JSP page. Any help will be appreciated! Thanks Regards Sujeet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable Lists: Can only move one row?
Hey Here is a very nice tutorial on Sortable Lists: http://zenofshen.com/posts/ajax-sortable-lists-tutorial However; when trying this myself I always end up with a list that works half way. The list loads and I can move an item, but that is it. I can not move any other items unless I reload the page and can then move another row? Any ideas on why this is happening? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] sortable tree in rails
Hi, I'm a new member to this group, and would appreciate some help with using Sortable in Rails. How do I generate a sortable tree like this with RoR? http://script.aculo.us/playground/test/functional/sortable_tree_test.html Specifically, the ability to drag a section and its children to another position. I'm using this code currently: %= sortable_element(articles, :url = sort, :constraint = :vertical, :tree = true) % And with a tree rendered like this: - Section 1 - article 1 - article 2 - article 3 - Section 2 - article 4 - Section 3 - article 5 - article 6 If I drag on Section 3, only Section 3 moves, article 5 6 don't go along with it. Is there any trick? Thanks, Robert --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable and lists of labels/checkboxes
Hi, I decided to open a new thread (this is the old one: http://groups.google.com/group/prototype-scriptaculous/t/303d050dd9c07329), because it is a general question how to use the Sortable of script.aculo.us correctly. Simple HTML-Code: ul id=list li id=item1labelinput type=checkbox / Item 1/label/li li id=item2labelinput type=checkbox / Item 2/label/li /ul Javascript: Sortable.create('list'); Works in all browsers. I just have a problem with Gecko and WebKit. Using the dragdrop by clicking on the labels also changes the state of the checkbox (checked/unchecked). I tried a lot of different thinks to avoid that behaviour. I think it would be the best solution to stop the whole event, after an item was dropped. Sortable.create offers two callbacks: onChange and onUpdate: onChange is called whenever the an item changes a position during the dragging. It has the item thats being dragged as a parameter. onUpdate is called when the item is actually dropped and the list has a new order. It has the whole list as parameter. Unfortunately I don't have an event object here, so I could work with that. What I did: I saved the checkbox that is dragged within onChange: onChange: function(element) { this.checkbox = element.select('input')[0]; } Within onUpdate I set this checkbox disabled. So the automatic click on it would have no effect: onUpdate: function(element) { if (Prototype.Browser.WebKit || Prototype.Browser.Gecko) { this.checkbox.disable(); } } Now I just need to add another click handler for the label and list to enable the checkbox: onClick = function(evt) { if (this.checkbox) { this.checkbox.enable(); evt.stop(); } }; $$('#list label').invoke('observe', 'click', onClick.bind(this)); $$('#list li').invoke('observe', 'click', onClick.bind(this)); This works now really good, just one thing keeps bugging me. When I press the mousebutton on a label to start dragging and releasing it not on the label, but somewhere else, the click event is not fired, so the checkbox remains disabled. This also happens the other way round: Start dragging on the list-item and releasing dropping it while the mouse is over the label. I could add even another mouse event handlers to the whole list: mouse = function(evt) { if (this.checkbox) { this.checkbox.enable(); } }; $('list').observe('mouseover', mouse.bind(this)).observe('mousemove', mouse.bind(this)); If you are not moving your mouse you can still see the disabled checkbox. I have no further ideas. I hope you can help me out. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable tree
Ok, I am really not the biggest JS guru on the planet. Consider me a newbie on SU and javascript. So, alright, here is the big plan: I have my small to do list and I want to be able to drag around items in the list. tasks can have subtasks and that should be the end of the line. no sub sub tasks. I am far away from realizing that. I think it might have been smarter to implement this directly using SU's drag and drop abilities. however, what i did try was forcing sortables to do what i want and i did not come far. not only am i far away from realizing the 2-level restriction; more importantly, i can't convince the library to allow drops on empty items. i gave them an empty sublist. i turned on drop on empty. i added a display:none child element to the sublists. nothing! in an ideal work, i would tackle the problem like this: in happy world, sortables would allow leaves to get child nodes without obstructions. i would set the only attribute to a class name, and after every update, i would update the classes so that only elements on the first level would have this class set, so nothing can be dragged beyond level 2. also, after every update, i would check if level 3 got created (could happen( and would smoothe it back to level 2. could someone give me a hand, please? regards, niko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable list - dynamic numbering?
Hi everyone, I've made a fairly basic Sortable - it's two lists and you can drag elements from one list to the (initially blank) second. My issue is that I want the second list to auto number itself as you add to it, eg, if you drag an element to the top of it, it's prefixed with a #1, or if it's at the bottom, it becomes #2, etc. The idea here is that I'm allowing users to assemble a top 25 list out of a selection of hundreds of items. Any tips on doing this? Thanks Matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable container that copies (dragdrop clone/copy) instead of moves?
I'm using Sortable.create on a few containers w/ div elements and rather than moving a div from container1 to container2, I want to copy and insert into container2. Has anyone found an example of this? The only bit I dug up is this: http://markmail.org/message/2tuf3k3sw6gl3z2x which would work if you create your own Draggable/Droppable elements, but it'd be nice to have a Sortable container so that once something is dropped, it can be rearranged. It'd also be able nice to be able to drop it at a specific point and have it land in the right place. thanks, ken --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable scrollSensitivity
Hi all, The argument of Sortable.create() : scrollSensitivity, will start scrolling when element is x pixels from the bottom, where x is the scrollSensitivity. But i want a feature that i can control the scrollSensitivity when element is x pixels from the bottom and y pixels from the top. Can anyone give me a good suggestion?? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---