Modals handled differently in 5.6.0.2

Permalink
Has anyone else noticed that you pass in an 'element' on a C5 dialog method that it will now 'copy' the DOM object as opposed to 'cutting' out of the DOM?

I've got some modal forms I'm using on the dashboard and they were not returning information correctly mainly because I was referencing them like $('#someform').submit(function(){...}).

I could referencing the form by via a class or (I guess) do something like $('#someform[1]').submit, but neither of these seem like proper way to handle this problem.

I'd love to know if anyone else has hun into this and if there is a good workaround.

Thanks!

cartersch
 
JohntheFish replied on at Permalink Reply
JohntheFish
Yes, its a definite improvement not to have to repair DOM, but a headache making code backward compatible.
cartersch replied on at Permalink Reply
cartersch
Yeah, I came up with a "simple" way to update my site to use the JqueryUI dialog box.

First I did a search on the project for any instances of '$.fn.dialog.open.' and anywhere there is an element referenced I would change it to read '$('#someElement').dialog.'

Next I would update the object by setting the width and height to integer values instead of strings. Finally, if I had any functions that needed to run on open or close, I just referenced them with the close or open object. So now my old C5 dialog scripts that looked something like this:

$.fn.dialog.open({
  modal : false,
  width  : '500px',
  height: '500px',
  element : '#targetEl',
  onDestroy : function(){
    doSomething();
  }
});


Now look like this :

$('#targetEl').dialog({
  modal : true,
  width  : 500,
  height : 500,
  close   : function(){
    doSomething();
  }
});