-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
If I run ajaxq in YM module (https://github.com/ymaps/modules), it runs once and then no ajax requests sends.
`
modules.define('main-tovar-tile',function(provide, prevC) {
provide({
init: function(){
var _this = this;
$("body").on("click",".main-tovar-tile__later-link",function(){
var i =$(this).find("i");
var id = 0;
if(i.hasClass("fa-heart")){
i.removeClass("fa-heart").addClass("fa-heart-o");
}
else{
i.removeClass("fa-heart-o").addClass("fa-heart");
id = $(this).data("id");
_this.send_to_wishes(id);
}
});
},
send_to_wishes: function(id){
$.ajaxq("atb",{
type : "post",
dataType : "json",
url : "/wp/wp-admin/admin-ajax.php?action=to_wishes",
data : {id:id},
success: function(response) {
if(response.success == true) {
$(window).trigger("add_to_wishes",{count:response.data.count});
alert(response.data.count);
}
}
});
}
});
});
modules.require("main-tovar-tile",function(provide){
provide.init();
});
`
Metadata
Metadata
Assignees
Labels
No labels