tagmanager icon indicating copy to clipboard operation
tagmanager copied to clipboard

Adding callbacks for AjaxPush

Open mkyung opened this issue 11 years ago • 4 comments

In the API I could not find any way to add callbacks for AjaxPush (POST a request when a user creates a tag). Am I missing something?

mkyung avatar Dec 23 '13 03:12 mkyung

In the latest code TagManager emits events tm:pushing before and tm:pushed after the Ajax push. You can subscribe to these using jQuery.

johnnyshields avatar Jan 12 '14 13:01 johnnyshields

Leaving this issue open as we need to document it.

johnnyshields avatar Jan 12 '14 13:01 johnnyshields

Is it possible to get an example how to use this events ?

KreizIT avatar Apr 03 '14 16:04 KreizIT

Example:

$('input#tag-box').on('tm:pushing', function(event, tag, tagId) {
    alert("Added: " + tag);
});
$('input#tag-box').on('tm:popping', function(event, tag, tagId) {
    alert("Removed: " + tag);
});

onlyafly avatar Nov 17 '14 06:11 onlyafly