Commit 83d10ed4 by Jeffrey Phillips

Use angular element click to dispatch anchor click event

Fixes #139
parent 76bddf5a
...@@ -1141,7 +1141,7 @@ angular.module('openshiftCommonUI') ...@@ -1141,7 +1141,7 @@ angular.module('openshiftCommonUI')
if (t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length) { if (t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length) {
return; return;
} }
$('a.tile-target', element).trigger("click"); angular.element($('a.tile-target', element))[0].click();
}); });
} }
}; };
......
...@@ -1312,7 +1312,7 @@ angular.module('openshiftCommonUI') ...@@ -1312,7 +1312,7 @@ angular.module('openshiftCommonUI')
if (t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length) { if (t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length) {
return; return;
} }
$('a.tile-target', element).trigger("click"); angular.element($('a.tile-target', element))[0].click();
}); });
} }
}; };
......
...@@ -444,7 +444,7 @@ restrict:"AC", ...@@ -444,7 +444,7 @@ restrict:"AC",
link:function($scope, element) { link:function($scope, element) {
$(element).click(function(evt) { $(element).click(function(evt) {
var t = $(evt.target); var t = $(evt.target);
t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length || $("a.tile-target", element).trigger("click"); t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length || angular.element($("a.tile-target", element))[0].click();
}); });
} }
}; };
......
...@@ -11,7 +11,7 @@ angular.module('openshiftCommonUI') ...@@ -11,7 +11,7 @@ angular.module('openshiftCommonUI')
if (t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length) { if (t && (t.closest("a", element).length || t.closest("button", element).length) || t.closest(".tile-click-prevent", element).length) {
return; return;
} }
$('a.tile-target', element).trigger("click"); angular.element($('a.tile-target', element))[0].click();
}); });
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment