/*! * resizable 1.0.1 * https://github.com/tannernetwork/resizable * * Copyright 2015-2017 Tanner (http://tanner.zone) * Released under the MIT license */ !function(a){a.fn.resizable=function(b){var c=a.extend({direction:["top","right","bottom","left"]},b),d=null;return this.each(function(){var b=this,e=a(this),f=!1,g={},h={top:!1,right:!1,bottom:!1,left:!1},i={};if(e.addClass("resizable"),c.direction instanceof Array)for(var j=c.direction.length-1;j>=0;j--)switch(c.direction[j]){case"top":case"t":h.top=!0;break;case"right":case"r":h.right=!0;break;case"bottom":case"b":h.bottom=!0;break;case"left":case"l":h.left=!0}else if("string"==typeof c.direction)switch(c.direction){case"vertical":case"v":h.top=!0,h.bottom=!0;break;case"horizontal":case"h":h.right=!0,h.left=!0;break;case"top":case"t":h.top=!0;break;case"right":case"r":h.right=!0;break;case"bottom":case"b":h.bottom=!0;break;case"left":case"l":h.left=!0}h.top&&(i.top=a("
").addClass("resizable-handle resizable-t").appendTo(e)),h.right&&(i.right=a("
").addClass("resizable-handle resizable-r").appendTo(e)),h.bottom&&(i.bottom=a("
").addClass("resizable-handle resizable-b").appendTo(e)),h.left&&(i.left=a("
").addClass("resizable-handle resizable-l").appendTo(e)),a(this).children(".resizable-l, .resizable-r, .resizable-t, .resizable-b").mousedown(function(h){d=b;var i;switch(!0){case a(this).hasClass("resizable-l"):i="l";break;case a(this).hasClass("resizable-r"):i="r";break;case a(this).hasClass("resizable-t"):i="t";break;case a(this).hasClass("resizable-b"):i="b"}f=!0,g={x:h.clientX,y:h.clientY,height:e.height(),width:e.width(),direction:i},a("html").addClass("resizable-resizing resizable-resizing-"+g.direction),d==b&&"function"==typeof c.start&&c.start.apply(b)}),a(window).mousemove(function(a){if(f){var h=a.clientX-g.x,i=a.clientY-g.y;switch(g.direction){case"r":e.width(g.width+h);break;case"l":e.width(g.width-h);break;case"b":e.height(g.height+i);break;case"t":e.height(g.height-i)}d==b&&"function"==typeof c.resize&&c.resize.apply(b)}}).mouseup(function(e){f=!1,a("html").removeClass("resizable-resizing resizable-resizing-"+g.direction),d==b&&"function"==typeof c.stop&&c.stop.apply(b),_current=null})})}}(jQuery);