Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions tagmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@

$el.find("#" + newTagRemoveId).on("click", $self, function(e) {
e.preventDefault();
var TagIdToRemove = parseInt($(this).attr("TagIdToRemove"));
if (opts.externalTagId === true) {
var TagIdToRemove = $(this).attr("TagIdToRemove");
} else {
var TagIdToRemove = parseInt($(this).attr("TagIdToRemove"));
}
privateMethods.spliceTag.call($self, TagIdToRemove, e.data);
});

Expand Down Expand Up @@ -190,8 +194,13 @@
// console.log(tlis);
}
},

removeTagByID : function (TagID) {
var $self = this;
privateMethods.spliceTag.call($self,TagID);
},

empty : function() {
empty : function(send_trigger) {
var $self = $(this), tlis = $self.data("tlis"), tlid = $self.data("tlid"), tagId;

while (tlid.length > 0) {
Expand All @@ -202,7 +211,9 @@
privateMethods.refreshHiddenTagList.call($self);
// console.log(tlis);
}
$self.trigger('tm:emptied', null);

send_trigger = (typeof send_trigger === "undefined") ? true : send_trigger;
if (send_trigger === true) $self.trigger('tm:emptied', null);

privateMethods.showOrHide.call($self);
//if (tagManagerOptions.maxTags > 0 && tlis.length < tagManagerOptions.maxTags) {
Expand All @@ -213,6 +224,12 @@
tags : function() {
var $self = this, tlis = $self.data("tlis");
return tlis;
},

// Return tags ID
tags_id: function() {
var $self = this, tlid = $self.data("tlid");
return tlid;
}
},

Expand Down Expand Up @@ -318,6 +335,10 @@
tlid.splice(idx, 1);
privateMethods.refreshHiddenTagList.call($self);
$self.trigger('tm:spliced', [tagBeingRemoved, tagId]);

if (tlis.length == 0) {
$self.trigger('tm:empty', null);
}
// console.log(tlis);
}

Expand Down