Skip to content

Commit

Permalink
#live is no longer supported, use on instead
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianrbz authored and Raven24 committed Feb 23, 2014
1 parent cc9c6c7 commit d3921f1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/app/app.js
Expand Up @@ -88,7 +88,7 @@ var app = {
Backbone.history.start({pushState: true});

// there's probably a better way to do this...
$("a[rel=backbone]").live("click", function(evt){
$(document).on("click", "a[rel=backbone]", function(evt){
evt.preventDefault();
var link = $(this);

Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/app/views/hovercard_view.js
Expand Up @@ -3,9 +3,9 @@ app.views.Hovercard = Backbone.View.extend({
el: '#hovercard_container',

initialize: function() {
$('.hovercardable')
.live('mouseenter', _.bind(this._mouseenterHandler, this))
.live('mouseleave', _.bind(this._mouseleaveHandler, this));
$(document)
.on('mouseenter', '.hovercardable', _.bind(this._mouseenterHandler, this))
.on('mouseleave', '.hovercardable', _.bind(this._mouseleaveHandler, this));

this.show_me = false;

Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/aspect-edit-pane.js
Expand Up @@ -17,11 +17,11 @@ function updatePageAspectName( an_id, new_name) {
}

$(document).ready(function() {
$('#rename_aspect_link').live('click', function(){
$('#aspect_name_title').on('click', '#rename_aspect_link', function(){
toggleAspectTitle();
});

$('form.edit_aspect').live('ajax:success', function(evt, data, status, xhr) {
$(document).on('ajax:success', 'form.edit_aspect', function(evt, data, status, xhr) {
updateAspectName(data['name']);
updatePageAspectName( data['id'], data['name'] );
toggleAspectTitle();
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/contact-list.js
Expand Up @@ -5,7 +5,7 @@

var List = {
initialize: function() {
$(".contact_list_search").live("keyup", function(e) {
$(document).on("keyup", ".contact_list_search", function(e) {
var search = $(this);
var list = $(".contacts", ".searchable");
var query = new RegExp(search.val(),'i');
Expand Down
11 changes: 2 additions & 9 deletions app/assets/javascripts/inbox.js
Expand Up @@ -28,13 +28,13 @@ $(document).ready(function(){
function(){
$(this).find('.participants').slideDown('300');
},

function(){
$(this).find('.participants').slideUp('300');
}
);

$('.conversation-wrapper').live('click', function(){
$(document).on('click', '.conversation-wrapper', function(){
var conversation_path = $(this).data('conversation-path');

$.getScript(conversation_path, function() {
Expand Down Expand Up @@ -101,11 +101,4 @@ $(document).ready(function(){
$(document).ajaxError(function(e,xhr,opt){
if (xhr.status == 404) { $('a.next_page').remove(); }
});

$('#reply_to_conversation').live('click', function(evt) {
evt.preventDefault();
$('html, body').animate({scrollTop:$(window).height()}, 'medium', function(){
$('#message_text').focus();
});
});
});
2 changes: 1 addition & 1 deletion app/assets/javascripts/mobile.js
Expand Up @@ -217,7 +217,7 @@ $(document).ready(function(){
form.remove();
});

$(".new_comment").live("submit", function(evt){
$(document).on("submit", ".new_comment", function(evt){
evt.preventDefault();
var form = $(this);

Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/view.js
Expand Up @@ -20,8 +20,8 @@ var View = {
.keypress(this.search.keyPress);

/* Dropdowns */
$(this.dropdowns.selector)
.live('click', this.dropdowns.click);
$(document)
.on('click', this.dropdowns.selector, this.dropdowns.click);

/* Avatars */
$(this.avatars.selector).error(this.avatars.fallback);
Expand All @@ -45,7 +45,7 @@ var View = {
});
};

$('form[data-remote]').live('ajax:success', function (e) {
$(document).on('ajax:success', 'form[data-remote]', function (e) {
$(this).clearForm();
$(this).focusout();
});
Expand Down Expand Up @@ -73,7 +73,7 @@ var View = {
});

/* facebox 'done' buttons */
$("*[rel*=close]").live('click', function(){ $.facebox.close(); });
$(document).on('click', "*[rel*=close]", function(){ $.facebox.close(); });

/* notification routing */
$("#notification").delegate('.hard_object_link', 'click', function(evt){
Expand Down

0 comments on commit d3921f1

Please sign in to comment.