@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines (2 loc) • 3.11 kB
JavaScript
!function(i,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("kendo.core.js"),require("kendo.draganddrop.js")):"function"==typeof define&&define.amd?define(["exports","kendo.core.min","kendo.draganddrop"],n):n(((i="undefined"!=typeof globalThis?globalThis:i||self).kendo=i.kendo||{},i.kendo._globals=i.kendo._globals||{},i.kendo._globals.Resizable={}))}(this,(function(i){!function(i,n){var t=window.kendo,o=t.ui,e=o.Widget,s=t.isFunction,r=i.extend,a="horizontal",d="vertical",l="start",c="resize",u="resizeend",p=e.extend({init:function(i,n){var t=this;e.fn.init.call(t,i,n),t.orientation=t.options.orientation.toLowerCase()!=d?a:d,t._positionMouse=t.orientation==a?"x":"y",t._position=t.orientation==a?"left":"top",t._sizingDom=t.orientation==a?"outerWidth":"outerHeight",t.draggable=new o.Draggable(n.draggableElement||i,{distance:1,filter:n.handle,drag:t._resize.bind(t),dragcancel:t._cancel.bind(t),dragstart:t._start.bind(t),dragend:t._dragend.bind(t),clickMoveClick:n.clickMoveClick}),t.userEvents=t.draggable.userEvents},events:[c,u,l],options:{name:"Resizable",orientation:a,clickMoveClick:!1},resize:function(){},_max:function(i){var t=this,o=t.hint?t.hint[t._sizingDom]():0,e=t.options.max;return s(e)?e(i):e!==n?t._initialElementPosition+e-o:e},_min:function(i){var t=this.options.min;return s(t)?t(i):t!==n?this._initialElementPosition+t:t},_start:function(n){var t=this,o=t.options.hint,e=i(n.currentTarget);t._initialElementPosition=e.position()[t._position],t._initialMousePosition=n[t._positionMouse].startLocation,o&&(t.hint=s(o)?i(o(e)):o,t.hint.css({position:"absolute"}).css(t._position,t._initialElementPosition).appendTo(t.element)),t.trigger(l,n),t._maxPosition=t._max(n),t._minPosition=t._min(n),i(document.body).css("cursor",e.css("cursor"))},_resize:function(i){var t,o=this,e=o._maxPosition,s=o._minPosition,a=o._initialElementPosition+(i[o._positionMouse].location-o._initialMousePosition);t=s!==n?Math.max(s,a):a,o.position=t=e!==n?Math.min(e,t):t,o.hint&&o.hint.toggleClass(o.options.invalidClass||"",t==e||t==s).css(o._position,t),o.resizing=!0,o.trigger(c,r(i,{position:t}))},_dragend:function(i){this._stop(),this.trigger(u,r(i,{position:this.position}))},_stop:function(){var n=this;n.hint&&n.hint.remove(),n.resizing=!1,i(document.body).css("cursor","")},_cancel:function(i){var t=this;t.hint&&(t.position=n,t.hint.css(t._position,t._initialElementPosition),t._stop())},destroy:function(){var i=this;e.fn.destroy.call(i),i.draggable&&i.draggable.destroy()},press:function(i){if(i){var n=i.position(),t=this;t.userEvents.press(n.left,n.top,i[0]),t.targetPosition=n,t.target=i}},move:function(i){var t=this,o=t._position,e=t.targetPosition,s=t.position;s===n&&(s=e[o]),e[o]=s+i,t.userEvents.move(e.left,e.top)},end:function(){this.userEvents.end(),this.target=this.position=n}});t.ui.plugin(p)}(window.kendo.jQuery);var n=kendo;i.__meta__={id:"resizable",name:"Resizable",category:"framework",depends:["core","draganddrop"],advanced:!0},i.default=n,Object.defineProperty(i,"__esModule",{value:!0})}));
//# sourceMappingURL=kendo.resizable.min.js.map