[#345] remove deprecated live event

This commit is contained in:
Alexander Machehin 2014-03-13 16:09:00 +06:00
parent bdcbc7e837
commit d51d917fa4
15 changed files with 49 additions and 49 deletions

View File

@ -53,11 +53,11 @@ $(document).ready(function() {
disableNotifierCbx($(this)); disableNotifierCbx($(this));
}); });
$('div.information > div.profile > a').live('click', function(e) { $('div.information > div.profile > a').on('click', function(e) {
e.preventDefault(); e.preventDefault();
}); });
$('.more_activities').live('click', function(){ $('.more_activities').on('click', function(){
var button = $(this); var button = $(this);
$.ajax({ $.ajax({
type: 'GET', type: 'GET',

View File

@ -19,7 +19,7 @@ $(document).ready(function() {
}); });
$('.data-expander').live('click', function(e) { $('.data-expander').on('click', function(e) {
var $button = $(e.target); var $button = $(e.target);
var id = "#content-" + $button.attr('id'); var id = "#content-" + $button.attr('id');
var $slider = $(id); var $slider = $(id);
@ -27,7 +27,7 @@ $(document).ready(function() {
$button.toggleClass('expanded collapsed'); $button.toggleClass('expanded collapsed');
}); });
}); });
function showActivity(elem) { function showActivity(elem) {
$("#activity-bottom"+elem).slideToggle("slow"); $("#activity-bottom"+elem).slideToggle("slow");
var img = document.getElementById("expand" + elem).className; var img = document.getElementById("expand" + elem).className;
@ -38,7 +38,7 @@ $(document).ready(function() {
} }
} }
$('div.information > div.user').live('click', function() { $('div.information > div.user').on('click', function() {
dropbox.slideToggle("slow"); dropbox.slideToggle("slow");
}); });
}); });

View File

@ -1,6 +1,6 @@
$(document).ready(function() { $(document).ready(function() {
$(".div-filter-labels").live('click', function() { $(".div-filter-labels").on('click', function() {
var flag = this.id; var flag = this.id;
flag = flag.replace("label-","flag-"); flag = flag.replace("label-","flag-");
var bg = $("#"+flag).css("background-color"); var bg = $("#"+flag).css("background-color");

View File

@ -23,7 +23,7 @@ $(document).ready(function() {
return false; return false;
} }
profile_vis_buttons.live('click', function () { profile_vis_buttons.on('click', function () {
profile_vis_buttons.toggleClass('active'); profile_vis_buttons.toggleClass('active');
return load_profile_projects(); return load_profile_projects();
}); });

View File

@ -1,6 +1,6 @@
$(document).ready(function() { $(document).ready(function() {
$("#manage-labels").live('click', function () { $("#manage-labels").on('click', function () {
var toggled = $(this).data('toggled'); var toggled = $(this).data('toggled');
$(this).data('toggled', !toggled); $(this).data('toggled', !toggled);
if (!toggled) { if (!toggled) {
@ -13,16 +13,16 @@ $(document).ready(function() {
} }
}); });
$("div.div-tracker-labels").live('click', function() { $("div.div-tracker-labels").on('click', function() {
return send_index_tracker_request('GET'); return send_index_tracker_request('GET');
}); });
$("#table1.issues-table .pagination a").live('click', function() { $("#table1.issues-table .pagination a").on('click', function() {
updatePagination($(this)); updatePagination($(this));
return send_index_tracker_request('GET'); return send_index_tracker_request('GET');
}); });
$(".issues-filter .tabnav-tabs li").live('click', function() { $(".issues-filter .tabnav-tabs li").on('click', function() {
var li = $(this); var li = $(this);
var items = $('.issues-filter .tabnav-tabs'); var items = $('.issues-filter .tabnav-tabs');
if (li.hasClass('list-browser-sorts')) { if (li.hasClass('list-browser-sorts')) {
@ -39,23 +39,23 @@ $(document).ready(function() {
return send_index_tracker_request('GET'); return send_index_tracker_request('GET');
}); });
$("#filter_issues #myradio1").live('change', function(event) { $("#filter_issues #myradio1").on('change', function(event) {
return send_index_tracker_request('GET'); return send_index_tracker_request('GET');
}); });
$('.ajax_search_form').live('submit', function() { $('.ajax_search_form').on('submit', function() {
return send_index_tracker_request('GET', $(this).attr("action")); return send_index_tracker_request('GET', $(this).attr("action"));
}); });
$('#add_label').live('click', function() { $('#add_label').on('click', function() {
return send_index_tracker_request('POST', $(this).attr("href"), $('#new_label').serialize()); return send_index_tracker_request('POST', $(this).attr("href"), $('#new_label').serialize());
}); });
$('.righter #update_label').live('click', function() { $('.righter #update_label').on('click', function() {
return send_index_tracker_request('POST', $(this).attr("href"), $(this).parents('#update_label').serialize()); return send_index_tracker_request('POST', $(this).attr("href"), $(this).parents('#update_label').serialize());
}); });
$('.colors .choose').live('click', function() { $('.colors .choose').on('click', function() {
var parent = $(this).parents('.colors'); var parent = $(this).parents('.colors');
parent.find('.choose.selected').removeClass('selected'); parent.find('.choose.selected').removeClass('selected');
$(this).addClass('selected'); $(this).addClass('selected');
@ -63,18 +63,18 @@ $(document).ready(function() {
return false; return false;
}); });
$('.custom_color').live('click', function() { $('.custom_color').on('click', function() {
$(this).siblings('#label_color').toggle(); $(this).siblings('#label_color').toggle();
return false; return false;
}); });
$('article a.edit_label').live('click', function() { $('article a.edit_label').on('click', function() {
$(this).parents('.label.edit').siblings('.label.edit').find('.edit_label_form').hide(); $(this).parents('.label.edit').siblings('.label.edit').find('.edit_label_form').hide();
$(this).parents('.label.edit').find('.edit_label_form').toggle(); $(this).parents('.label.edit').find('.edit_label_form').toggle();
return false; return false;
}); });
$('.delete_label').live('click', function() { $('.delete_label').on('click', function() {
return send_index_tracker_request('POST', $(this).attr('href')); return send_index_tracker_request('POST', $(this).attr('href'));
}); });
@ -112,15 +112,15 @@ $(document).ready(function() {
return search_items(path, data, dom); return search_items(path, data, dom);
}); });
$('.users-search-popup .header .icon-remove-circle').live('click', function() { $('.users-search-popup .header .icon-remove-circle').on('click', function() {
$('.users-search-popup').hide(); $('.users-search-popup').hide();
}); });
$('#assigned-container .icon-share').live('click', function() { $('#assigned-container .icon-share').on('click', function() {
$('#assigned-popup').show(); $('#assigned-popup').show();
}); });
$('#assigned-popup .people.selected').live('click', function() { $('#assigned-popup .people.selected').on('click', function() {
var form = $('#assigned-popup .edit_assignee'); var form = $('#assigned-popup .edit_assignee');
var item = $(this); var item = $(this);
if (form.length == 0) { if (form.length == 0) {
@ -141,7 +141,7 @@ $(document).ready(function() {
return false; return false;
}); });
$('.add_label.label').live('click', function() { $('.add_label.label').on('click', function() {
$(this).addClass('selected').removeClass('add_label').addClass('remove_label'); $(this).addClass('selected').removeClass('add_label').addClass('remove_label');
$(this).find('.labeltext').addClass('selected'); $(this).find('.labeltext').addClass('selected');
var style = $(this).find('.flag').attr('style'); var style = $(this).find('.flag').attr('style');
@ -155,7 +155,7 @@ $(document).ready(function() {
labels.append($(this).find('#'+$(this).attr('id'))); labels.append($(this).find('#'+$(this).attr('id')));
}); });
$('.remove_label.label.selected').live('click', function() { $('.remove_label.label.selected').on('click', function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
$('.manage_labels, #active_labels').find('#'+id+'.label.selected.remove_label').remove(); $('.manage_labels, #active_labels').find('#'+id+'.label.selected.remove_label').remove();
var form = $('.form.issue'); var form = $('.form.issue');
@ -171,7 +171,7 @@ $(document).ready(function() {
$('.manage_labels').find('#'+$(this).attr('id')).remove(); $('.manage_labels').find('#'+$(this).attr('id')).remove();
}); });
$('.issue_status.switch_issue_status').live('click', function () { $('.issue_status.switch_issue_status').on('click', function () {
var button = $(this); var button = $(this);
var status = (button.hasClass('switcher')) ? 'closed' : 'open'; var status = (button.hasClass('switcher')) ? 'closed' : 'open';
var form = $('#update_issue_status'); var form = $('#update_issue_status');
@ -192,17 +192,17 @@ $(document).ready(function() {
return false; return false;
}); });
$('#edit_issue_content').live('click', function() { $('#edit_issue_content').on('click', function() {
$('.edit_form.issue').fadeIn('fast'); $('.edit_form.issue').fadeIn('fast');
$(this).fadeOut('fast'); $(this).fadeOut('fast');
}); });
$('#cancel_edit_issue_content').live('click', function() { $('#cancel_edit_issue_content').on('click', function() {
$('.edit_form.issue').fadeOut('fast'); $('.edit_form.issue').fadeOut('fast');
$('#edit_issue_content').fadeIn('fast'); $('#edit_issue_content').fadeIn('fast');
}); });
$('.edit_form.issue').live('submit', function() { $('.edit_form.issue').on('submit', function() {
var form = $(this); var form = $(this);
form.parent().find('.flash').remove(); form.parent().find('.flash').remove();
$.ajax({ $.ajax({
@ -222,14 +222,14 @@ $(document).ready(function() {
return false; return false;
}); });
$('.button.manage_labels').live('click', function() { $('.button.manage_labels').on('click', function() {
$('.button.update_labels').fadeIn(0); $('.button.update_labels').fadeIn(0);
$('.current_labels .label .labeltext.selected').parent().addClass('remove_label selected').removeClass('nopointer'); $('.current_labels .label .labeltext.selected').parent().addClass('remove_label selected').removeClass('nopointer');
$('.current_labels .label .labeltext:not(.selected)').parent().addClass('add_label').removeClass('nopointer'); $('.current_labels .label .labeltext:not(.selected)').parent().addClass('add_label').removeClass('nopointer');
$(this).fadeOut(0); $(this).fadeOut(0);
}); });
$('.button.update_labels').live('click', function() { $('.button.update_labels').on('click', function() {
var form = $('form.edit_labels.issue'); var form = $('form.edit_labels.issue');
$.ajax({ $.ajax({
type: 'POST', type: 'POST',

View File

@ -4,16 +4,16 @@ $(document).ready(function() {
var login_default = $('#login_default').val(); var login_default = $('#login_default').val();
var pass_default = $('#password_default').val(); var pass_default = $('#password_default').val();
$('.registartion-input').live('keydown', function() { $('.registartion-input').on('keydown', function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
if(id == 'user_login' || id == 'user_password') { id = 'login_error'} if(id == 'user_login' || id == 'user_password') { id = 'login_error'}
$('.error.'+id).fadeOut('slow'); $('.error.'+id).fadeOut('slow');
}).live('focus', function() { }).on('focus', function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
if(id == 'user_login' && $(this).val() == login_default) { $(this).val('')} if(id == 'user_login' && $(this).val() == login_default) { $(this).val('')}
else if(id == 'user_password' && $(this).val() == pass_default) { $(this).val('')} else if(id == 'user_password' && $(this).val() == pass_default) { $(this).val('')}
$(this).addClass('registartion-input-focus').removeClass('registartion-input-error'); $(this).addClass('registartion-input-focus').removeClass('registartion-input-error');
}).live('blur', function() { }).on('blur', function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
if(id == 'user_login' && $(this).val() == '') { $(this).val(login_default)} if(id == 'user_login' && $(this).val() == '') { $(this).val(login_default)}
else if(id == 'user_password' && $(this).val() == '') { $(this).val(pass_default)} else if(id == 'user_password' && $(this).val() == '') { $(this).val(pass_default)}

View File

@ -5,7 +5,7 @@
//= require ./design/all //= require ./design/all
$(document).ready(function() { $(document).ready(function() {
$('div.information > div.profile > a').live('click', function(e) { $('div.information > div.profile > a').on('click', function(e) {
e.preventDefault(); e.preventDefault();
}); });
}); });

View File

@ -45,12 +45,12 @@
var change_update_type = function (type) { var change_update_type = function (type) {
$('input#update_type').val(type); $('input#update_type').val(type);
}; };
$('#approve_registration').live('click', function(e) { $('#approve_registration').on('click', function(e) {
//set update_type to 'approve' //set update_type to 'approve'
change_update_type('approve'); change_update_type('approve');
$form.submit(); $form.submit();
}); });
$('#reject_registration').live('click', function(e) { $('#reject_registration').on('click', function(e) {
//set update_type to 'reject' //set update_type to 'reject'
change_update_type('reject'); change_update_type('reject');
$form.submit(); $form.submit();

View File

@ -33,6 +33,6 @@
= render 'submenu' = render 'submenu'
:javascript :javascript
$('#users_filter[type="radio"]').live('change', function(){ $('#users_filter[type="radio"]').on('change', function(){
$('#datatable').dataTable().fnDraw(); $('#datatable').dataTable().fnDraw();
}); });

View File

@ -27,9 +27,9 @@
$('#command_string').val(list[$platform.val()][$arch.val()]); $('#command_string').val(list[$platform.val()][$arch.val()]);
// alert('hello'); // alert('hello');
} }
$("select#platform").live('change', path_getter); $("select#platform").on('change', path_getter);
$("select#arch").live('change', path_getter); $("select#arch").on('change', path_getter);
$("textarea#command_string").live('click', function() { $("textarea#command_string").on('click', function() {
this.select(); this.select();
}); });
path_getter(); path_getter();

View File

@ -7,7 +7,7 @@
:javascript :javascript
$(document).ready(function() { $(document).ready(function() {
$('select#branch_selector').live('change', function(e) { $('select#branch_selector').on('change', function(e) {
$form = $('form#branch_changer'); $form = $('form#branch_changer');
$form.attr('action', $(this).val()); $form.attr('action', $(this).val());
$form.submit(); $form.submit();

View File

@ -48,7 +48,7 @@
.both .both
:javascript :javascript
$(document).ready(function() { $(document).ready(function() {
$('#url').live('click', function() { $('#url').on('click', function() {
$(this).select(); $(this).select();
}); });
}); });

View File

@ -93,7 +93,7 @@
}); });
var $search = $('#search'); var $search = $('#search');
$search.live('blur', function() { $search.on('blur', function() {
$this = $(this); $this = $(this);
if ($this.val() == '') { if ($this.val() == '') {
$this.val('#{ t('layout.find_project') }'); $this.val('#{ t('layout.find_project') }');
@ -101,7 +101,7 @@
} }
return true; return true;
}); });
$search.live('focus', function() { $search.on('focus', function() {
$this = $(this); $this = $(this);
if ($this.val() == '#{ t('layout.find_project') }') { if ($this.val() == '#{ t('layout.find_project') }') {
$this.val(''); $this.val('');
@ -109,13 +109,13 @@
} }
return true; return true;
}); });
$search.live('keyup', function() { $search.on('keyup', function() {
oTable.fnFilter(this.value); oTable.fnFilter(this.value);
}); });
$(".div-filter-labels").live('click', function() { $(".div-filter-labels").on('click', function() {
oTable.dataTable().fnDraw(); oTable.dataTable().fnDraw();
}); });
$('#filter_projects').live('submit', function() { $('#filter_projects').on('submit', function() {
return false; return false;
}); });
}); });

View File

@ -10,7 +10,7 @@
$('.name #url-field').text(link.attr('href')); $('.name #url-field').text(link.attr('href'));
$('.role').text(link.attr('data-permissions')); $('.role').text(link.attr('data-permissions'));
$('.name a').live('click', function(e) { $('.name a').on('click', function(e) {
e.preventDefault(); e.preventDefault();
$('.name #url-field').text($(this).attr('href')); $('.name #url-field').text($(this).attr('href'));
$('.role').text($(this).attr('data-permissions')); $('.role').text($(this).attr('data-permissions'));

View File

@ -28,6 +28,6 @@ div_reg.piroFadeIn(300,function(){div_reg.load(p_link);piro_loader.hide();});bre
div_reg.piroFadeIn(300,function(){$(p_link).clone(true).appendTo(div_reg).piroFadeIn(300);piro_loader.hide();});break div_reg.piroFadeIn(300,function(){$(p_link).clone(true).appendTo(div_reg).piroFadeIn(300);piro_loader.hide();});break
case'gallery':div_reg.css('overflow','hidden');resize.css('overflow','hidden');$('.my_frame').remove();piro_close.add(btn_info).add(piro_capt).hide();if(descr==""){piro_capt.html('');}else{piro_capt.html('<p>'+descr+'</p>');} case'gallery':div_reg.css('overflow','hidden');resize.css('overflow','hidden');$('.my_frame').remove();piro_close.add(btn_info).add(piro_capt).hide();if(descr==""){piro_capt.html('');}else{piro_capt.html('<p>'+descr+'</p>');}
animate_image();break;case'single':piro_close.add(btn_info).add(piro_capt).hide();div_reg.html('').css('overflow','hidden');resize.css('overflow','hidden');$('.my_frame').remove();if(descr==""){piro_capt.html('');}else{piro_capt.html('<p>'+descr+'</p>');} animate_image();break;case'single':piro_close.add(btn_info).add(piro_capt).hide();div_reg.html('').css('overflow','hidden');resize.css('overflow','hidden');$('.my_frame').remove();if(descr==""){piro_capt.html('');}else{piro_capt.html('<p>'+descr+'</p>');}
animate_image();break}}});$('.immagine').live('click',function(){piro_capt.slideToggle(200);});function close_all(){if($('.piro_close').is(':visible')){$('.my_frame').remove();wrapper.add(div_reg).add(resize).stop();var ie_sucks=wrapper;if($.browser.msie){ie_sucks=div_reg.add(piro_bg);$('.div_reg img').remove();}else{ie_sucks=wrapper.add(piro_bg);} animate_image();break}}});$('.immagine').on('click',function(){piro_capt.slideToggle(200);});function close_all(){if($('.piro_close').is(':visible')){$('.my_frame').remove();wrapper.add(div_reg).add(resize).stop();var ie_sucks=wrapper;if($.browser.msie){ie_sucks=div_reg.add(piro_bg);$('.div_reg img').remove();}else{ie_sucks=wrapper.add(piro_bg);}
ie_sucks.piroFadeOut(200,function(){div_reg.html('');piro_loader.add(piro_capt).add(btn_info).hide();$('.nav_container').hide();piro_bg.add(wrapper).hide().css('visibility','visible');});}} ie_sucks.piroFadeOut(200,function(){div_reg.html('');piro_loader.add(piro_capt).add(btn_info).hide();$('.nav_container').hide();piro_bg.add(wrapper).hide().css('visibility','visible');});}}
piro_close.add(piro_loader).add(piro_bg).bind('click',function(y){y.preventDefault();close_all();});}})(jQuery); piro_close.add(piro_loader).add(piro_bg).bind('click',function(y){y.preventDefault();close_all();});}})(jQuery);