/* * TwoPane Plugin - v0.3.1 * jQuery UI plugin to handle a resizable two-pane view (commander-like :) * https://github.com/giosh94mhz/twopane * * Copyright (C) 2015 Giorgio Premi * Licensed under MIT License * See LICENSE file for the full copyright notice. */ (function($, undefined) { "user strict"; // overridden options var optionsOverride = { handles: "w" }; function trimMinMax(min, value, max) { if (min && value < min) { value = min; } else if (max && value > max) { value = max; } return value; } function resizeTo(newSize, axis) { if (axis === undefined) { axis = 'se'; } var start = new $.Event("mousedown", { pageX: 0, pageY: 0 }); this._mouseStart(start); this.axis = axis; var end = new $.Event("mouseup", { pageX: newSize.width - this.originalSize.width, pageY: newSize.height - this.originalSize.height }); this._mouseDrag(end); this._mouseStop(end); } $.widget('giosh94mhz.twopane', { options: { left: '> *:nth-child(1)', right: '> *:nth-child(2)', resizable: { helper: "ui-resizable-helper ui-corner-all" } }, _create: function () { this.element.addClass('giosh94mhz-twopane'); this.oldContent = $('