Tweak to splitter, don't do DOM manip if not dragging

Sample: http://d.pr/i/pEKj
This commit is contained in:
Remy Sharp 2013-09-01 10:37:23 +01:00
parent 70c69179ef
commit 32ecf62bac

View File

@ -3,10 +3,10 @@
$blocker = $('<div class="block"></div>'),
$body = $('body');
// blockiframe = $blocker.find('iframe')[0];
var splitterSettings = JSON.parse(localStorage.getItem('splitterSettings') || '[]');
return this.each(function () {
var $el = $(this),
var $el = $(this),
$originalContainer = $(this),
guid = $.fn.splitter.guid++,
$parent = $el.parent(),
@ -143,10 +143,12 @@
}
$document.bind('mouseup touchend', function () {
dragging = false;
$blocker.remove();
// $handle.css( 'opacity', '0');
$body.removeClass('dragging');
if (dragging) {
dragging = false;
$blocker.remove();
// $handle.css( 'opacity', '0');
$body.removeClass('dragging');
}
}).bind('mousemove touchmove', function (event) {
if (dragging) {
moveSplitter(event[props[type].moveProp] || event.originalEvent.touches[0][props[type].moveProp]);
@ -198,7 +200,7 @@
$el.css('border-top', 0);
// $prev.css('border-right', '2px solid #ccc');
}
if ($el.is(':hidden')) {
$handle.hide();
} else {
@ -276,7 +278,7 @@
var otherhandles = $el.find('.resize');
otherhandles.each(function (i) {
// find the top of the
// find the top of the
var $h = $(this);
if (this === $handle[0]) {
// ignore