Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/assets/javascripts/best_in_place.jquery-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ BestInPlaceEditor.forms.date = {
this.element.html(output);
this.setHtmlAttributes();
this.element.find('input')[0].select();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
this.element.find("input").bind('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
this.element.find("form").on('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
this.element.find("input").on('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);

this.element.find('input')
.datepicker({
Expand All @@ -55,4 +55,4 @@ BestInPlaceEditor.forms.date = {
event.data.editor.abort();
}
}
}
}
32 changes: 16 additions & 16 deletions lib/assets/javascripts/best_in_place.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function BestInPlaceEditor(e) {
this.initOptions();
this.bindForm();
this.initPlaceHolder();
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
jQuery(this.activator).on('click', {editor: this}, this.clickHandler);
}

BestInPlaceEditor.prototype = {
Expand Down Expand Up @@ -74,7 +74,7 @@ BestInPlaceEditor.prototype = {
abort: function () {
'use strict';
this.activateText(this.oldValue);
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
jQuery(this.activator).on('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:abort"));
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
},
Expand Down Expand Up @@ -314,7 +314,7 @@ BestInPlaceEditor.prototype = {
this.element.trigger(jQuery.Event("ajax:success"), [data, status, xhr]);

// Binding back after being clicked
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
jQuery(this.activator).on('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:deactivate"));

if (this.collectionValue !== null && this.formType === "select") {
Expand All @@ -331,7 +331,7 @@ BestInPlaceEditor.prototype = {
this.element.trigger(jQuery.Event("ajax:error"), request, error);

// Binding back after being clicked
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
jQuery(this.activator).on('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
},

Expand Down Expand Up @@ -405,14 +405,14 @@ BestInPlaceEditor.forms = {
this.setHtmlAttributes();

this.element.find("input[type='text']")[0].select();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
this.element.find("form").on('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
if (this.cancelButton) {
this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.input.cancelButtonHandler);
this.element.find("input[type='button']").on('click', {editor: this}, BestInPlaceEditor.forms.input.cancelButtonHandler);
}
if (!this.okButton) {
this.element.find("input[type='text']").bind('blur', {editor: this}, BestInPlaceEditor.forms.input.inputBlurHandler);
this.element.find("input[type='text']").on('blur', {editor: this}, BestInPlaceEditor.forms.input.inputBlurHandler);
}
this.element.find("input[type='text']").bind('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
this.element.find("input[type='text']").on('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
this.blurTimer = null;
this.userClicked = false;
},
Expand Down Expand Up @@ -497,9 +497,9 @@ BestInPlaceEditor.forms = {

this.element.html(output);
this.setHtmlAttributes();
this.element.find("select").bind('change', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").bind('blur', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").bind('keyup', {editor: this}, BestInPlaceEditor.forms.select.keyupHandler);
this.element.find("select").on('change', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").on('blur', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").on('keyup', {editor: this}, BestInPlaceEditor.forms.select.keyupHandler);
this.element.find("select")[0].focus();

// automatically click on the select so you
Expand Down Expand Up @@ -578,16 +578,16 @@ BestInPlaceEditor.forms = {
jQuery(this.element.find("textarea")[0]).autosize();

this.element.find("textarea")[0].focus();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.textarea.submitHandler);
this.element.find("form").on('submit', {editor: this}, BestInPlaceEditor.forms.textarea.submitHandler);

if (this.cancelButton) {
this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.textarea.cancelButtonHandler);
this.element.find("input[type='button']").on('click', {editor: this}, BestInPlaceEditor.forms.textarea.cancelButtonHandler);
}

if (!this.skipBlur) {
this.element.find("textarea").bind('blur', {editor: this}, BestInPlaceEditor.forms.textarea.blurHandler);
this.element.find("textarea").on('blur', {editor: this}, BestInPlaceEditor.forms.textarea.blurHandler);
}
this.element.find("textarea").bind('keyup', {editor: this}, BestInPlaceEditor.forms.textarea.keyupHandler);
this.element.find("textarea").on('keyup', {editor: this}, BestInPlaceEditor.forms.textarea.keyupHandler);
this.blurTimer = null;
this.userClicked = false;
},
Expand Down Expand Up @@ -668,7 +668,7 @@ jQuery.fn.best_in_place = function () {
}
}

jQuery(this.context).delegate(this.selector, 'click', function () {
jQuery(this.context).on(this.selector, 'click', function () {
var el = jQuery(this);
if (setBestInPlace(el)) {
el.click();
Expand Down