mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-25 15:38:56 +00:00
Tweak to splitter, don't do DOM manip if not dragging
Sample: http://d.pr/i/pEKj
This commit is contained in:
parent
70c69179ef
commit
32ecf62bac
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user