Note that there are some explanatory texts on larger screens.

plurals
  1. POWhere has fn.toggle( handler(eventObject), handler(eventObject)...) gone?
    primarykey
    data
    text
    <p>I have <a href="http://jsfiddle.net/mplungjan/eQZp4/" rel="noreferrer">this jsfiddle</a> </p> <p>which uses <a href="http://api.jquery.com/toggle-event/" rel="noreferrer">toggle event</a> - not to be confued with <a href="http://api.jquery.com/toggle/" rel="noreferrer">toggle</a> - jQuery version set to <strong>EDGE</strong></p> <p>It suddenly stopped working and removed the cell I wanted as a trigger, since it obviously reverts to <a href="http://api.jquery.com/toggle/" rel="noreferrer">toggle</a>. </p> <p>I cannot find any deprecation tags or such</p> <p><a href="http://api.jquery.com/category/deprecated/" rel="noreferrer">http://api.jquery.com/category/deprecated/</a> gives a 404</p> <p>If I add the <a href="https://github.com/jquery/jquery-migrate" rel="noreferrer">Migrate</a> module my <a href="http://jsfiddle.net/mplungjan/cBgtn/" rel="noreferrer">jsFiddle then works</a> and I see the warning in the console (elaborated by <a href="https://github.com/jquery/jquery-migrate/blob/master/warnings.md" rel="noreferrer">https://github.com/jquery/jquery-migrate/blob/master/warnings.md</a> as posted by Frédéric Hamidi)</p> <p>I see <a href="https://github.com/jquery/jquery/pull/970" rel="noreferrer">Deprecate fn toggle</a> and <a href="https://github.com/jquery/2012-dev-summit/issues/24" rel="noreferrer">issue 24</a> and <a href="http://bugs.jquery.com/ticket/11786" rel="noreferrer">Ticket #11786</a> but not in places I would expect to see it.</p> <p>What am I missing and where do I find the replacement and documentation for it?</p> <p>NOTE: I understand the reason for deprecation, I just can't find <em>official</em> documentation for the deprecation</p> <pre><code>$('#tbl .xx').toggle( function() { $(this).siblings().each(function(){ var t = $(this).text(); $(this).html($('&lt;input /&gt;',{'value' : t})); }); }, function() { $(this).siblings().each(function(){ var inp = $(this).find('input'); if (inp.length){ $(this).text(inp.val()); } }); } ); </code></pre> <p>Code in MIGRATE:</p> <pre><code>jQuery.fn.toggle = function( fn, fn2 ) { // Don't mess with animation or css toggles if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) { return oldToggle.apply( this, arguments ); } migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated"); // Save reference to arguments for access in closure var args = arguments, guid = fn.guid || jQuery.guid++, i = 0, toggler = function( event ) { // Figure out which function to execute var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; }; // link all the functions, so any of them can unbind this click handler toggler.guid = guid; while ( i &lt; args.length ) { args[ i++ ].guid = guid; } return this.click( toggler ); }; </code></pre> <p><strong>UPDATE</strong> I have asked if they could keep the code as fn.toggler so it is a rename instead of a remove</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload