/** * jQuery shorten v0.3.2 * https://github.com/amazingSurge/jquery-shorten * * Copyright (c) amazingSurge * Released under the LGPL-3.0 license */ !function(e,t){if("function"==typeof define&&define.amd)define(["jquery"],t);else if("undefined"!=typeof exports)t(require("jquery"));else{var n={exports:{}};t(e.jQuery),e.jqueryShortenEs=n.exports}}(this,function(e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(e){return e&&e.__esModule?e:{default:e}}(e),s=function(){function e(e,t){for(var n=0;n1?t-1:0),s=1;s'+this.detailText+""+this._toggleHtml())}},{key:"_ellipsesHtml",value:function(){return this.options.ellipses?''+this.options.ellipses+"":""}},{key:"_toggleHtml",value:function(){var e;return e=this.expanded?this.options.less:this.options.more,''+e+""}},{key:"_bindEvents",value:function(){this.$toggle=this.$element.find("."+this.namespace+"-toggle");var e=this;this.$element.on("click.shorten","."+this.namespace+"-toggle",function(){return e.expanded?(e._trigger("collapse"),(0,n.default)(this).html(e.options.more)):(e._trigger("expand"),(0,n.default)(this).html(e.options.less)),!1})}},{key:"needShorten",value:function(){return this.text.length>this.options.chars}},{key:"text",value:function(){return this.text}},{key:"expand",value:function(){this._trigger("expand")}},{key:"collapse",value:function(){this._trigger("collapse")}},{key:"destroy",value:function(){this.$element.html(this.text),this.$element.data("shorten",null),this.$element.off(".shorten"),this.$element.off("shorten::expand"),this.$element.off("shorten::collapse")}},{key:"update",value:function(e){this.text=e,this.needShorten()?this.prepare():this.$element.html(e),this._trigger("expand",e)}}],[{key:"setDefaults",value:function(e){n.default.extend(i,n.default.isPlainObject(e)&&e)}}]),e}(),r={version:"0.3.2"},o=n.default.fn.shorten,l=function(e){for(var t=arguments.length,s=Array(t>1?t-1:0),i=1;i