Created
March 7, 2014 00:09
-
-
Save melbourne2991/9402480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.full_wrap').mousedown(function(e) { | |
// get container co ordinates | |
var tcw= $('.tags_container.stores_only').width(), | |
tch= $('.tags_container.stores_only').height(), | |
tct= $('.tags_container.stores_only').offset().top, | |
tcl= $('.tags_container.stores_only').offset().left; | |
// calculate selectable zone | |
var xCoordsMin = tcl, | |
xCoordsMax = tcl + tcw, | |
yCoordsMin = tct, | |
yCoordsMax = tct + tch; | |
// only trigger if a click occurs outside of the selectable zone, | |
// clicks that occur within the selectable zone are handled | |
// by jquery ui. | |
if(yCoordsMax > e.pageY < yCoordsMin && xCoordsMax > e.pageX < xCoordsMin) { | |
if(!$(e.toElement).parent().hasClass('ui-selectee')) { | |
$('.ui-selected').removeClass('ui-selected'); | |
$('.ui-click-select').removeClass('ui-click-select'); | |
$('#drag_multiple_button').hide(); | |
} | |
} else { | |
console.log('in'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment