UNPKG

@xiee/utils

Version:

Miscellaneous tools and utilities to manipulate HTML pages

2 lines 1.17 kB
jQuery.fn.disableTextSelect=function(){return this.each((function(){$(this).css({MozUserSelect:"none",webkitUserSelect:"none"}).attr("unselectable","on").bind("selectstart",(function(){return!1}))}))},jQuery.fn.enableTextSelect=function(){return this.each((function(){$(this).css({MozUserSelect:"",webkitUserSelect:""}).attr("unselectable","off").unbind("selectstart")}))},$(document).ready((function(){var e=$("td.docs"),t=$("td.code"),s=$("div.handler");s.css("height",$("table").css("height")),s.css("left",t.offset().left);var n=parseInt(e.css("padding-right")),c=parseInt(e.css("padding-left")),o=parseInt(s.css("width"));s.mousedown((function(){$("body").disableTextSelect(),$(document).bind("mousemove",(function(i){var a=i.pageX-e.offset().left-n-c-.5*o;e.width(a),s.css("left",t.offset().left)})).mouseup((function(){$("body").enableTextSelect(),$(document).unbind("mousemove")}))}));var i="both";$(document).keydown((function(n){if(84==n.which)switch(i){case"both":t.hide(500),s.hide(),i="left";break;case"left":t.show(500),e.hide(500),i="right";break;case"right":t.show(500),e.show(500),s.show(500),i="both"}}))})); //# sourceMappingURL=docco-resize.min.js.map