Fix JS calls to jQuery's live() function, deprecated in favor of on() (but replaced by click() in all cases here) - refs BT#9435

1.10.x
Yannick Warnier 10 years ago
parent 124f65d141
commit 987c5d4de3
  1. 2
      main/admin/user_list.php
  2. 2
      main/auth/courses.php
  3. 6
      main/social/group_topics.php
  4. 6
      main/template/default/skill/skill_tree.tpl
  5. 4
      main/template/default/skill/skill_tree_student.tpl
  6. 39
      plugin/ticket/src/tutor.php
  7. 2
      whoisonline.php

@ -124,7 +124,7 @@ $(document).ready(function() {
} }
} }
$(".agenda_opener").live("click", function() { $(".agenda_opener").click(function() {
var url = this.href; var url = this.href;
var dialog = $("#dialog"); var dialog = $("#dialog");

@ -19,7 +19,7 @@ if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$htmlHeadXtra[] = ' $htmlHeadXtra[] = '
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$(\'.ajax\').live(\'click\', function() { $(\'.ajax\').click(function() {
var url = this.href; var url = this.href;
var dialog = $("#dialog"); var dialog = $("#dialog");
if ($("#dialog").length == 0) { if ($("#dialog").length == 0) {

@ -176,7 +176,7 @@ $(document).ready(function() {
}) })
} }
$(\'.group_message_popup\').live(\'click\', function() { $(\'.group_message_popup\').click(function() {
var url = this.href; var url = this.href;
var dialog = $("#dialog"); var dialog = $("#dialog");
if ($("#dialog").length == 0) { if ($("#dialog").length == 0) {
@ -191,13 +191,13 @@ $(document).ready(function() {
dialog.dialog({ dialog.dialog({
modal : true, modal : true,
width : 520, width : 520,
height : 400, height : 400
}); });
}); });
//prevent the browser to follow the link //prevent the browser to follow the link
return false; return false;
});
}); });
});
</script>'; </script>';

@ -69,7 +69,7 @@ jsPlumb.ready(function() {
}); });
//Return to root button //Return to root button
$('#return_to_root').live('click', function(){ $('#return_to_root').click(function(){
clean_values(); clean_values();
console.log('Clean values'); console.log('Clean values');
console.log('Reopen the root '); console.log('Reopen the root ');
@ -193,7 +193,7 @@ jsPlumb.ready(function() {
}); });
//Clicking in a box skill (we use live instead of bind because we're creating divs on the fly ) //Clicking in a box skill (we use live instead of bind because we're creating divs on the fly )
$(".open_block").live('click', function() { $(".open_block").click(function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
console.log('click.open_block id: ' + id); console.log('click.open_block id: ' + id);
@ -271,7 +271,7 @@ jsPlumb.ready(function() {
}); });
//Skill title click //Skill title click
$(".edit_block").live('click',function() { $(".edit_block").click(function() {
var my_id = $(this).attr('id'); var my_id = $(this).attr('id');
my_id = my_id.split('_')[2]; my_id = my_id.split('_')[2];

@ -41,7 +41,7 @@ jsPlumb.bind("ready", function() {
}); });
//Clicking in a box skill (we use live instead of bind because we're creating divs on the fly ) //Clicking in a box skill (we use live instead of bind because we're creating divs on the fly )
$(".open_block").live('click', function() { $(".open_block").click(function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
console.log('click.open_block id: ' + id); console.log('click.open_block id: ' + id);
@ -119,7 +119,7 @@ jsPlumb.bind("ready", function() {
}); });
$(".edit_block").live('click',function() { $(".edit_block").click(function() {
var my_id = $(this).attr('id'); var my_id = $(this).attr('id');
my_id = my_id.split('_')[2]; my_id = my_id.split('_')[2];

@ -13,26 +13,27 @@ require_once 'tutor_report.lib.php';
$htmlHeadXtra[] = ' $htmlHeadXtra[] = '
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function (){ $(document).ready(function (){
$(".ajax").live("click", function() { $(".ajax").click(function() {
var url = this.href; var url = this.href;
var dialog = $("#dialog"); var dialog = $("#dialog");
if ($("#dialog").length == 0) { if ($("#dialog").length == 0) {
dialog = $("' . '<div id="dialog" style="display:hidden"></div>' . '").appendTo("body"); dialog = $("' . '<div id="dialog" style="display:hidden"></div>' . '").appendTo("body");
} }
// load remote content // load remote content
dialog.load( dialog.load(
url, url,
{}, {},
function(responseText, textStatus, XMLHttpRequest) { function(responseText, textStatus, XMLHttpRequest) {
dialog.dialog({ dialog.dialog({
modal : true, modal : true,
width : 540, width : 540,
height : 400 height : 400
}); });
}); }
//prevent the browser to follow the link );
return false; //prevent the browser to follow the link
return false;
}); });
}); });

@ -65,7 +65,7 @@ function hide_icon_edit(element_html) {
$(document).ready(function() { $(document).ready(function() {
$("#link_load_more_items").live("click", function() { $("#link_load_more_items").click(function() {
page = $("#link_load_more_items").attr("data_link"); page = $("#link_load_more_items").attr("data_link");
$.ajax({ $.ajax({
beforeSend: function(objeto) { beforeSend: function(objeto) {

Loading…
Cancel
Save