Changeset 101721 in spip-zone


Ignore:
Timestamp:
Jan 14, 2017, 11:14:14 PM (2 years ago)
Author:
marcimat@…
Message:

Compatibilité jQuery 3.1 (.bind => .on, .unbind => .off)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _core_/plugins/forum/formulaires/inc-forum_previsu.html

    r93296 r101721  
    2727<br class="clear" />
    2828<script type="text/javascript">/*<![CDATA[*/
    29 if (window.jQuery){ jQuery(function(){
     29if (window.jQuery){ jQuery(function($){
    3030        var confirm_quit = true;
    31         jQuery(window).unload(function() { if (confirm_quit) alert('<:forum:forum_attention_message_non_poste|texte_script:>');jQuery(window).unbind();});
    32         jQuery(window).on('beforeunload', function(e){ jQuery(window).unbind();if (!confirm_quit) return;e.returnValue='<:forum:forum_attention_message_non_poste|texte_script:>';return e.returnValue; });
    33         jQuery('fieldset.previsu').closest('form').next('form').bind('submit',function(){
     31        $(window).on('unload', function() {
     32                if (confirm_quit) alert('<:forum:forum_attention_message_non_poste|texte_script:>');
     33                $(window).off();
     34        });
     35        $(window).on('beforeunload', function(e){
     36                $(window).off();
     37                if (!confirm_quit) return;
     38                e.returnValue='<:forum:forum_attention_message_non_poste|texte_script:>';
     39                return e.returnValue;
     40        });
     41        $('fieldset.previsu').closest('form').next('form').on('submit', function(){
    3442                confirm_quit=false;
    3543        });
Note: See TracChangeset for help on using the changeset viewer.