admin管理员组文章数量:1130349
I want to ask question about events in backbone. I have problem to run some function when hook is triggerd.
I want to
wp.media.view.AttachmentCompat.prototype .on("attachment:compat:ready", function (e) {
console.log("READYY");
});
But this isn't working. What object handle the events of AttachmentCompat ? Maybe i do it to early ?
I was able to run my function by extending , but for me isn't best way.
var AttachmentCompatNew = wp.media.view.AttachmentCompat.extend({
postSave: function () {
this.controller.trigger('attachment:compat:ready', ['ready']);
}
});
wp.media.view.AttachmentCompat.prototype = AttachmentCompatNew.prototype;
Can some one help me to understand how i can trigger my functions on diffrent events ??
I want to ask question about events in backbone. I have problem to run some function when hook is triggerd.
I want to
wp.media.view.AttachmentCompat.prototype .on("attachment:compat:ready", function (e) {
console.log("READYY");
});
But this isn't working. What object handle the events of AttachmentCompat ? Maybe i do it to early ?
I was able to run my function by extending , but for me isn't best way.
var AttachmentCompatNew = wp.media.view.AttachmentCompat.extend({
postSave: function () {
this.controller.trigger('attachment:compat:ready', ['ready']);
}
});
wp.media.view.AttachmentCompat.prototype = AttachmentCompatNew.prototype;
Can some one help me to understand how i can trigger my functions on diffrent events ??
Share Improve this question asked Dec 6, 2018 at 11:42 PawelCPawelC 213 bronze badges1 Answer
Reset to default 1 if (wp.media) {
wp.media.view.AttachmentCompat.prototype.on("ready", function (e) {
console.log("Kompat Ready mokor 12");
});
}
This event name is "ready" :) works now fine . Maybe this will help someone.
I want to ask question about events in backbone. I have problem to run some function when hook is triggerd.
I want to
wp.media.view.AttachmentCompat.prototype .on("attachment:compat:ready", function (e) {
console.log("READYY");
});
But this isn't working. What object handle the events of AttachmentCompat ? Maybe i do it to early ?
I was able to run my function by extending , but for me isn't best way.
var AttachmentCompatNew = wp.media.view.AttachmentCompat.extend({
postSave: function () {
this.controller.trigger('attachment:compat:ready', ['ready']);
}
});
wp.media.view.AttachmentCompat.prototype = AttachmentCompatNew.prototype;
Can some one help me to understand how i can trigger my functions on diffrent events ??
I want to ask question about events in backbone. I have problem to run some function when hook is triggerd.
I want to
wp.media.view.AttachmentCompat.prototype .on("attachment:compat:ready", function (e) {
console.log("READYY");
});
But this isn't working. What object handle the events of AttachmentCompat ? Maybe i do it to early ?
I was able to run my function by extending , but for me isn't best way.
var AttachmentCompatNew = wp.media.view.AttachmentCompat.extend({
postSave: function () {
this.controller.trigger('attachment:compat:ready', ['ready']);
}
});
wp.media.view.AttachmentCompat.prototype = AttachmentCompatNew.prototype;
Can some one help me to understand how i can trigger my functions on diffrent events ??
Share Improve this question asked Dec 6, 2018 at 11:42 PawelCPawelC 213 bronze badges1 Answer
Reset to default 1 if (wp.media) {
wp.media.view.AttachmentCompat.prototype.on("ready", function (e) {
console.log("Kompat Ready mokor 12");
});
}
This event name is "ready" :) works now fine . Maybe this will help someone.
本文标签: plugin developmentBackbone event attachmentcompatready can39t hook
版权声明:本文标题:plugin development - Backbone event attachment:compat:ready can't hook 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749109485a2317135.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论