Skip to content

Commit

Permalink
Bind on-outside-click to mousedown rather than click
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemegson committed Aug 26, 2019
1 parent d86db3f commit 304230d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,18 @@ angular.module('umbraco.directives')
return attrs.bindClickOn;
}, function (newValue) {
if (newValue === "true") {
$(document).on("click", oneTimeClick);
$(document).on("mousedown", oneTimeClick);
} else {
$(document).off("click", oneTimeClick);
$(document).off("mousedown", oneTimeClick);
}
}));

} else {
$(document).on("click", oneTimeClick);
$(document).on("mousedown", oneTimeClick);
}

scope.$on("$destroy", function () {
$(document).off("click", oneTimeClick);
$(document).off("mousedown", oneTimeClick);

// unbind watchers
for (var e in eventBindings) {
Expand Down

0 comments on commit 304230d

Please sign in to comment.