ui-router support mock-clicks/events with no data, fixes #406

This commit is contained in:
Adam Bradley
2014-01-20 09:19:26 -06:00
parent 6b9291825a
commit 343279dae4
2 changed files with 44 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
/**
* State-based routing for AngularJS
* @version v0.2.8
* @version v0.2.8, with commit:
* https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418#diff-544b7ce9751e1a566e17d486dd4ab576
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
@@ -2394,7 +2395,7 @@ function $StateRefDirective($state, $timeout) {
element.bind("click", function(e) {
var button = e.which || e.button;
if ((button === 0 || button == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey && !element.attr('target')) {
if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {
// HACK: This is to allow ng-clicks to be processed before the transition is initiated:
$timeout(function() {
$state.go(ref.state, params, { relative: base });

View File

File diff suppressed because one or more lines are too long