From 79dc5cd2255d98fbe73452738886d11bb15ab13e Mon Sep 17 00:00:00 2001 From: Sean Coker Date: Fri, 1 Jun 2018 20:16:13 -0400 Subject: [PATCH] Bump to 1.14.0 --- bower.json | 2 +- example/index.html | 12 ++++++++++-- example/js/taggle.min.js | 4 ++-- package.json | 2 +- src/taggle.js | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index bf5e443..a16898d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "taggle", - "version": "1.13.0", + "version": "1.14.0", "homepage": "http://sean.is/poppin/tags", "authors": [ "Sean Coker " diff --git a/example/index.html b/example/index.html index 448e3b8..f1b5efb 100644 --- a/example/index.html +++ b/example/index.html @@ -401,8 +401,16 @@

Methods

Set options at runtime. This should be an object with the taggle options as keys

-

add(tag(s))

-

Pass an array of strings or just one string to programatically add tags.

+

add(tag(s), [index])

+

Pass an array of strings or just one string to programatically add tags at an optional index.

+
+
+

edit(text, index)

+

Edit tag text at a specified index.

+
+
+

move(fromIndex, destinationIndex)

+

Move a tag from a certain index to a another index.

remove(tag, remove_all=false)

diff --git a/example/js/taggle.min.js b/example/js/taggle.min.js index 0716fdc..68af605 100644 --- a/example/js/taggle.min.js +++ b/example/js/taggle.min.js @@ -1,8 +1,8 @@ /*! * @author Sean Coker -* @version 1.13.0 +* @version 1.14.0 * @url http://sean.is/poppin/tags * @license MIT * @description Taggle is a dependency-less tagging library */ -!function(){Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),window.getComputedStyle||(window.getComputedStyle=function(a){return a.currentStyle}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){"use strict";if(null==this)throw new TypeError;var b,c,d=Object(this),e=d.length>>>0;if(0===e)return-1;if(b=0,arguments.length>1&&(b=Number(arguments[1]),b!=b?b=0:0!=b&&b!=1/0&&b!=-(1/0)&&(b=(b>0||-1)*Math.floor(Math.abs(b)))),b>=e)return-1;for(c=b>=0?b:Math.max(e-Math.abs(b),0);c>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;d>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=new Array(g),e=0;e-1&&(this.settings.duplicateTagClass&&d.childNodes[c].classList.add(this.settings.duplicateTagClass),!0)},n.prototype._isConfirmKey=function(a){var b=!1;return this.settings.submitKeys.indexOf(a)>-1&&(b=!0),b},n.prototype._focusInput=function(){this._fixInputWidth(),this.container.classList.contains(this.settings.containerFocusClass)||this.container.classList.add(this.settings.containerFocusClass),this.placeholder&&(this.placeholder.style.opacity=0)},n.prototype._blurEvent=function(a){if(this.container.classList.contains(this.settings.containerFocusClass)&&this.container.classList.remove(this.settings.containerFocusClass),this.settings.saveOnBlur){if(a=a||window.event,this._listenForEndOfContainer(),""!==this.input.value)return void this._confirmValidTagEvent(a);this.tag.values.length&&this._checkLastTag(a)}else this.settings.clearOnBlur&&(this.input.value="",this._setInputWidth());this.tag.values.length||this.input.value||this._showPlaceholder()},n.prototype._keydownEvents=function(a){a=a||window.event;var b=a.keyCode;return this.pasting=!1,this._listenForEndOfContainer(),86===b&&a.metaKey&&(this.pasting=!0),this._isConfirmKey(b)&&""!==this.input.value?void this._confirmValidTagEvent(a):void(this.tag.values.length&&this._checkLastTag(a))},n.prototype._keyupEvents=function(a){a=a||window.event,this.input.classList.remove("taggle_back"),f(this.sizer,this.input.value),this.pasting&&""!==this.input.value&&(this._add(a),this.pasting=!1)},n.prototype._confirmValidTagEvent=function(a){a=a||window.event,a.preventDefault?a.preventDefault():a.returnValue=!1,this._add(a)},n.prototype._listenForEndOfContainer=function(){var a=this.sizer.getBoundingClientRect().width,b=this.measurements.container.rect.width-this.measurements.container.padding,c=parseInt(this.sizer.style.fontSize,10);a+1.5*c>parseInt(this.input.style.width,10)&&(this.input.style.width=b+"px")},n.prototype._createTag=function(a){var b,d=document.createElement("li"),e=document.createElement("input"),g=document.createElement("span");try{b=document.createElement('