Fix the loading block wouldn't disappear in Mac OS X

In linux, Windows open new tab by Ctrl/Shift + mouse click. But, in
Mac OS X is using Command key + mouse click. So, when using Mac OS X
to open new tab by Command key + mouse click, loading block show up
function will not be excaped, and the loading block don't disappear.

Add "ev.metaKey" to check Command key is pressed, and don't execute
loading block show up function.

Closes-Bug: #1468706
Change-Id: I2f38b5e19137403d5191492b68f39fba2cdc6863
This commit is contained in:
JasonPan 2015-07-13 17:19:12 +08:00
parent a336dbd707
commit d533eb58f4

View File

@ -85,7 +85,7 @@ horizon.addInitFunction(function() {
// in the other browser tab with mouse wheel or mouse lbutton + modifier // in the other browser tab with mouse wheel or mouse lbutton + modifier
if ( ev.which !== MOUSE_WHEEL_CODE_NORMALIZED && if ( ev.which !== MOUSE_WHEEL_CODE_NORMALIZED &&
!( ev.which === MOUSE_LBUTTON_CODE_NORMALIZED && !( ev.which === MOUSE_LBUTTON_CODE_NORMALIZED &&
( ev.shiftKey || ev.ctrlKey ) ) ) { ( ev.shiftKey || ev.ctrlKey || ev.metaKey ) ) ) {
horizon.modals.modal_spinner(gettext("Loading")); horizon.modals.modal_spinner(gettext("Loading"));
} }
}); });