angular-stackables
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "angular-stackables", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "AngularJS stackable widgets built on HTML5 dialog.", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "angular-stackables", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"dependencies": {} | ||
} |
@@ -204,5 +204,8 @@ /*! | ||
function closeOnClick(e) { | ||
// close if target is not in the popover | ||
// close if target is not in the popover and trigger was not clicked | ||
// (also clear trigger click status) | ||
var target = angular.element(e.target); | ||
if(target.closest(element).length === 0) { | ||
var triggerClicked = scope.state.triggerClicked; | ||
scope.state.triggerClicked = false; | ||
if(!triggerClicked && target.closest(element).length === 0) { | ||
scope.state.show = false; | ||
@@ -313,4 +316,12 @@ scope.$apply(); | ||
// default to click | ||
element.on('click', function(e) { | ||
e.stopPropagation(); | ||
element.on('click', function() { | ||
// clear any selection | ||
if(document.selection && document.selection.empty) { | ||
document.selection.empty(); | ||
} else if(window.getSelection) { | ||
window.getSelection().removeAllRanges(); | ||
} | ||
// indicate trigger was clicked | ||
state.triggerClicked = true; | ||
state.show = !state.show; | ||
@@ -317,0 +328,0 @@ updateState(state); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22329
632