Re: [jQuery] Interface Sortables - class instability

2007-02-28 Thread Michael Crowl

Thanks for the responses Mark, and that's exactly what I've done, and I 
still have the same problem.

Could someone explain to me exactly how Sortables/Draggables/Droppables 
works, and how classes get assigned during the drag process?  I 
understand that once a drag is activated, a copy of the active container 
is created - but even if I assign it a root class, it's still not 
applied.  This behavior occurs in both Firefox and IE, so I'm assuming 
it's something I'm doing, but I can't figure it out.  Note that the 
original classes/styles do snap back after drop - it's just during the drag.

A simplified example:

div class='reorderlist'
div class='reorderrow' id='row1'
   div class='handle'X/div
   div class='title'Title 1/div
   div class='description'Description 1/div
/div
div class='reorderrow' id='row2'
   div class='handle'X/div
   div class='title'Title 2/div
   div class='description'Description 2/div
/div
/div

Styles are generally set as:
.reorderrow {style}
.reorderrow div.handle {style}
.reorderrow div.title {style}
.reorderrow div.description {style}

Now I initialize the list as Sortable:

$('div.reorderlist').Sortable(
{
accept: 'reorderrow',
activeclass: 'reorderrow',
hoverclass: 'reorderrow',
helperclass: 'reorderrow',
handle: 'div.handle',
axis: 'vertically',
tolerance: 'pointer'
}
);

The result is that the list is Sortable, and styles behave normally.  
But on drag, both the draggable and the hovered row revert to Times New 
Roman, large fonts, and I can't trace it back.  All styles go back to 
what's expected after drop.

Does anyone know the mechanics behind how the containers are copied, so 
I can troubleshoot this?  As much as I love what the Interfaces plugin 
can do, the documentation is terrible.  Yes, all parameters are listed 
there, with some broken English, but there is no explanation of how it 
works, what containers it works on, or pitfalls.  No offense meant - 
it's just frustrating.

-- mike


Mark wrote:
 i think it`s best to just rewrite it to use divs and no tables. other 
 than that i have no idea how to resolve it.

 2007/2/27, Michael Crowl [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:


 Thanks for the response, Mark, that's what I suspected - I had done a
 search, but my local email archives didn't go back that far.

 So here's a separate problem: Now I'm using one DIV as the sortable
 container, than each sortable item is a DIV wrapped around a
 single-row
 TABLE, so I could keep the current design.  Unfortunately, on drag the
 entire table and all of its TDs (even elements inside the TDs) lose
 their classes entirely.  Makes for a very ugly drag.  Setting
 activeclass doesn't help, because all that does is assert a class
 on the
 DIV wrapping the table - nothing helps the table cells and contents
 maintain their original classes.  In other words, I want to move each
 DIV (wrapped around table) WITHOUT Sortables destroying the existing
 CSS.  Note that once the drag is done, the original styles reassert
 themselves - it's only on drag.

 Anyone have any tips?

 -- mike


 Mark wrote:
  i believe there was a whole discussion about this somewhere in just
  june or july archives of this list in 2006.. the result of that is
  that you can`t do it with tr`s because you will need to create a
  complete table just for that one TR and that should be done be
  javascript.. or that`s how i understood it.
 
  best thing to do is using divs or li`s like in the example.
 
 
  2007/2/27, Michael Crowl [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]:
 
 
  Is it possible to use Sortables to sort table rows?  I
 haven't had
  much
  luck with it - the rows become malformed and break on drag,
 and they
  don't stay fixed within the width of the table.
 
  I've moved on to working with DIVs instead, but using table
 rows
  would
  have been cleaner.
 
  -- mike
 
 
  ___
  jQuery mailing list
  discuss@jquery.com mailto:discuss@jquery.com
 mailto:discuss@jquery.com mailto:discuss@jquery.com
  http://jquery.com/discuss/
 
 
 
 

 
  ___
  jQuery mailing list
  discuss@jquery.com mailto:discuss@jquery.com
  http://jquery.com/discuss/ http://jquery.com/discuss/
 

 --


 | Michael Crowl
 | Web Developer
 | [EMAIL PROTECTED] mailto:[EMAIL PROTECTED

Re: [jQuery] Interface Sortables - class instability

2007-02-28 Thread Michael Crowl

And, of course, as soon as I wrote that all out and sent it, I figured 
it out.

The designer was using 1.2em, etc for font sizes, which meant 
relatively, once the copy of the container was made, the fonts got amped 
up.  But relative to what?  The original?

It brings up the question of where in the DOM the copy actually resides 
and how classes get inherited once a copy is made.  Perhaps a question 
for the jQuery experts.

-- mike


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Interface Sortables - tables?

2007-02-27 Thread Michael Crowl

Is it possible to use Sortables to sort table rows?  I haven't had much 
luck with it - the rows become malformed and break on drag, and they 
don't stay fixed within the width of the table.

I've moved on to working with DIVs instead, but using table rows would 
have been cleaner.

-- mike


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Interface Sortables - table classes inside DIVs

2007-02-27 Thread Michael Crowl

Thanks for the response, Mark, that's what I suspected - I had done a 
search, but my local email archives didn't go back that far.

So here's a separate problem: Now I'm using one DIV as the sortable 
container, than each sortable item is a DIV wrapped around a single-row 
TABLE, so I could keep the current design.  Unfortunately, on drag the 
entire table and all of its TDs (even elements inside the TDs) lose 
their classes entirely.  Makes for a very ugly drag.  Setting 
activeclass doesn't help, because all that does is assert a class on the 
DIV wrapping the table - nothing helps the table cells and contents 
maintain their original classes.  In other words, I want to move each 
DIV (wrapped around table) WITHOUT Sortables destroying the existing 
CSS.  Note that once the drag is done, the original styles reassert 
themselves - it's only on drag.

Anyone have any tips?

-- mike


Mark wrote:
 i believe there was a whole discussion about this somewhere in just 
 june or july archives of this list in 2006.. the result of that is 
 that you can`t do it with tr`s because you will need to create a 
 complete table just for that one TR and that should be done be 
 javascript.. or that`s how i understood it.

 best thing to do is using divs or li`s like in the example.


 2007/2/27, Michael Crowl [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:


 Is it possible to use Sortables to sort table rows?  I haven't had
 much
 luck with it - the rows become malformed and break on drag, and they
 don't stay fixed within the width of the table.

 I've moved on to working with DIVs instead, but using table rows
 would
 have been cleaner.

 -- mike


 ___
 jQuery mailing list
 discuss@jquery.com mailto:discuss@jquery.com
 http://jquery.com/discuss/


 

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
   

-- 


| Michael Crowl
| Web Developer
| [EMAIL PROTECTED]



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unsubscribe me, please

2006-12-16 Thread Michael Crowl

Hey, how about clicking that link at the bottom of every single post?  
There are unsub instructions there!

Happy Travels and Merry Holiday-Of-Your-Choice!

-- m


daniele novaga wrote:
 unsubscribe me, please
 

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Firefox Javascript console hangs with jQuery?

2006-10-20 Thread Michael Crowl

Yup - can't tell if it's when there are certain timeouts running or 
not.  It even happens when all I've done is declared a 
$(document).ready() with nothing in it.

W2K
Firefox 1.5.0.7
jQuery 1.0.2

-- mike


Ⓙⓐⓚⓔ wrote:
 you have debugger enabled in firebug? I had a similar problem.

 On 10/19/06, Michael Crowl [EMAIL PROTECTED] wrote:
   
 On any page with jQuery included, when I try to open the Javascript
 console Firefox hangs for a bit and eventually asks me if I want to
 stop the currently running script.  This occurs whether the console
 has been cleared or not, and on pages where jQuery is the only
 Javascript on the page - even if there are no currently running
 functions, as far as I can tell.

 Haven't been able to find anyone else mentioning this problem anywhere.

 -- mike


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 


   

-- 


| Michael Crowl
| Web Developer
| [EMAIL PROTECTED]



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Firefox Javascript console hangs with jQuery?

2006-10-19 Thread Michael Crowl

On any page with jQuery included, when I try to open the Javascript 
console Firefox hangs for a bit and eventually asks me if I want to 
stop the currently running script.  This occurs whether the console 
has been cleared or not, and on pages where jQuery is the only 
Javascript on the page - even if there are no currently running 
functions, as far as I can tell.

Haven't been able to find anyone else mentioning this problem anywhere.

-- mike


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] fundamentals: .index(obj) or better solution

2006-10-18 Thread Michael Crowl

John -

Thank you, that worked!  Part of what confused me was that index() is 
defined as having an Obj as the argument, but not what kind - my 
attempts at using an expression as an argument were failing, so I was 
running out of ideas.  I wasn't following context properly.

Have enjoyed working with jQuery lately, nice update.

-- mike


John Resig wrote:
 .index() doesn't do what you think it does. It works like this:

 // Find the position of the P that an ID of someP /within/ the list of
 p elements.
 $(p).index( $(#someP)[0] )

 So, in your code it would be something like this:

 // div i want to find
 id = 3;

 // get the element i want to move
 var curr_obj = $([EMAIL PROTECTED]'id[]'[EMAIL 
 PROTECTED]'+id+']).parent()[0];

 // determine its current location within the set of list_items
 var old_pos = $(div.list_item).index(curr_obj);

 So two things to note: .get() returns an array of elements, not just a
 single element and  .index() works over a list of elements, not the
 children of an element. I hope this makes sense, it is something of
 confusing method. I plan on polishing it up some, as it was a late
 addition to 1.0.

 --John

 On 10/17/06, Michael Crowl [EMAIL PROTECTED] wrote:
   
 .index() is driving me nuts, and I'm trying to figure out if there's an
 obvious solution to what I'm trying to do, or if I'm missing something
 in the API.

 Let's say I have the following:

 div name=list

 div class='list_item'
 input type='hidden' name='id[]' value='1'
 // interface
 /div

 div class='list_item'
 input type='hidden' name='id[]' value='2'
 // interface
 /div

 div class='list_item'
 input type='hidden' name='id[]' value='3'
 // interface
 /div

 div class='list_item'
 input type='hidden' name='id[]' value='4'
 // interface
 /div

 /div

 How do I determine the current element position of a particular
 list_item in that container, using jQuery?

 Using .index(), it seems like this should work:

 // div i want to find
 id = 3;
 // get the element i want to move
 var curr_obj = $([EMAIL PROTECTED]'id[]'[EMAIL 
 PROTECTED]'+id+']).parent().get();
 // determine its current location within the set of list_items
 var old_pos = $(#list).index(curr_obj);

 ...or a number of other combinations I've tried, and none of them can
 get anything but -1 from .index().

 What am I doing wrong here?
 - Does .get() really return an element object?  (It seems to.)
 - What kind of object is .index() looking for?
 

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] fundamentals: .index(obj) or better solution

2006-10-16 Thread Michael Crowl

.index() is driving me nuts, and I'm trying to figure out if there's an 
obvious solution to what I'm trying to do, or if I'm missing something 
in the API.

Let's say I have the following:

div name=list

div class='list_item'
input type='hidden' name='id[]' value='1'
// interface
/div

div class='list_item'
input type='hidden' name='id[]' value='2'
// interface
/div

div class='list_item'
input type='hidden' name='id[]' value='3'
// interface
/div

div class='list_item'
input type='hidden' name='id[]' value='4'
// interface
/div

/div

How do I determine the current element position of a particular 
list_item in that container, using jQuery?

Using .index(), it seems like this should work:

// div i want to find
id = 3;
// get the element i want to move
var curr_obj = $([EMAIL PROTECTED]'id[]'[EMAIL 
PROTECTED]'+id+']).parent().get();
// determine its current location within the set of list_items
var old_pos = $(#list).index(curr_obj);

...or a number of other combinations I've tried, and none of them can 
get anything but -1 from .index().

What am I doing wrong here?
- Does .get() really return an element object?  (It seems to.)
- What kind of object is .index() looking for?

-- 


| Michael Crowl
| Web Developer
| [EMAIL PROTECTED]



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/