2
У меня есть vehicle
и объект product
, и мне нужно транспортное средство, чтобы вызвать функцию внутри продукта .... Я не могу понять, что мне делать здесь?Переменная Область: вызов функции кросс-класса
var vehicle = function() {
return {
init: function() {
var that = this;
jQuery('.vehicle-year-profile .options .delete').bind('click', function (e) {
e.preventDefault();
that.remove(jQuery(e.currentTarget).parents('.vehicle-year-profile'));
});
jQuery('.vehicle-year-profile .options .edit').bind('click', function (e) {
e.preventDefault();
that.edit(jQuery(e.currentTarget).parents('.vehicle-year-profile').attr('id'));
});
jQuery('#association-detail .save').bind('click', function (e) {
e.preventDefault();
that.save();
});
},
edit: function (id) {},
save: function() {},
remove: function (el) {},
reset: function() {}
}
}();
var product = function() {
return {
refreshHistory: function() {}
};
}();
Спасибо @Marcel! Я стар и ничего не вижу :-) – Pointy