-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphicResizer.min.js
More file actions
8 lines (8 loc) · 1.77 KB
/
graphicResizer.min.js
File metadata and controls
8 lines (8 loc) · 1.77 KB
1
2
3
4
5
6
7
8
/*!
graphicResizer v1.0.1 (https://github.com/TechTarget/graphicResizer)
Author: Morgan Wigmanich <okize123@gmail.com> (http://github.com/okize)
Copyright (c) 2013 | Licensed under the MIT license
http://www.opensource.org/licenses/mit-license.php
*/
(function(){!function(e){return"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){"use strict";var t,n,i;i="graphicResizer",n={showToggle:!0,resizeSpeed:500,mouseEvent:"click",easing:{expand:"easeInCubic",collapse:"easeOutCubic"},toggleHtml:'<span class="embiggen"><span class="icon"></span></span>',callback:function(){}},t=function(){function t(t,s){this.element=t,this.options=e.extend({},n,s),this._defaults=n,this._name=i,this.el=e(this.element),this.init()}return t.prototype.init=function(){var t,n,i=this;return n=this.el.find(".toggleSize"),t=e(this.options.toggleHtml),this.options.showToggle&&n.prepend(t),n.on(this.options.mouseEvent,function(e){return e.preventDefault(),"expanded"===i.el.data("state")?(i.el.removeClass("figureExpanded").animate({width:i.el.data("origWidth")+"px"},{duration:i.options.resizeSpeed,easing:i.options.easing.expand},function(){return this.options.callback.call(this)}),t.toggleClass("embiggen smallify"),i.el.data("state","closed")):(i.el.addClass("figureExpanded").animate({width:"100%"},{duration:i.options.resizeSpeed,easing:i.options.easing.collapse},function(){return this.options.callback.call(this)}),t.toggleClass("embiggen smallify"),i.el.data("state","expanded"),i.el.data("origWidth",i.el.width()))})},t.prototype.expand=function(){},t.prototype.collapse=function(){},t}(),e.fn[i]=function(n){return this.each(function(){e.data(this,"plugin_#{pluginName}")||e.data(this,"plugin_#{pluginName}",new t(this,n))})}})}).call(this);
//# sourceMappingURL=graphicResizer.min.js.map