It's from editable fields that I want to override jQuery from. I tried to simply copy the function in question into my scripts.js and make it work but it obviously doesn't.
I'm sure my custom js file loads because I'm already using other code in it. Now, I just put a console.log statement in the beginning of my copied function that is supposed to fire at every .blur();
but nothing's coming out.
I also checked that my custom js code got loaded after the editable fields code (In case I sound stupid: I don't know how far drupal takes care of it to do this by default.)
this is the function - originally from editablefields - that I would like to override
(function ($) {
Drupal.behaviors.editablefields_submit = {
console.log('override check');
attach: function (context) {
$('.editablefield-item').once('editablefield', function() {
var $this = $(this);
// There is only one editable field in that form, we can hide the submit
// button.
if ($this.find('input[type=text],textarea,select').length == 1) {
$this.find('input.form-submit').hide();
$this.find('input[type=text],textarea,select').change(function() {
console.log('this out of override= ' + $this);
$this.find('input.form-submit').triggerHandler('click');
});
}
});
}
};