Merge "Prevent infinite 'Loading' spinner when using mouse"
This commit is contained in:
commit
4933517709
|
@ -1,5 +1,9 @@
|
||||||
horizon.addInitFunction(function() {
|
horizon.addInitFunction(function() {
|
||||||
var allPanelGroupBodies = $('.nav_accordion > dd > div > ul');
|
var allPanelGroupBodies = $('.nav_accordion > dd > div > ul');
|
||||||
|
// In case the event was generated by clicking any mouse button,
|
||||||
|
// the normalized codes are matched according to http://api.jquery.com/event.which/
|
||||||
|
var MOUSE_LBUTTON_CODE_NORMALIZED = 1;
|
||||||
|
var MOUSE_WHEEL_CODE_NORMALIZED = 2;
|
||||||
|
|
||||||
// mark the active panel group
|
// mark the active panel group
|
||||||
var activePanel = $('.nav_accordion > dd > div > ul > li > a.active');
|
var activePanel = $('.nav_accordion > dd > div > ul > li > a.active');
|
||||||
|
@ -76,8 +80,14 @@ horizon.addInitFunction(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// panel selection
|
// panel selection
|
||||||
$('.nav_accordion > dd > div > ul > li > a').click(function() {
|
$('.nav_accordion > dd > div > ul > li > a').click(function(ev) {
|
||||||
horizon.modals.modal_spinner(gettext("Loading"));
|
// NOTE(tsufiev): prevent infinite 'Loading' spinner when opening link
|
||||||
|
// in the other browser tab with mouse wheel or mouse lbutton + modifier
|
||||||
|
if ( ev.which !== MOUSE_WHEEL_CODE_NORMALIZED &&
|
||||||
|
!( ev.which === MOUSE_LBUTTON_CODE_NORMALIZED &&
|
||||||
|
( ev.shiftKey || ev.ctrlKey ) ) ) {
|
||||||
|
horizon.modals.modal_spinner(gettext("Loading"));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue