Browse Source

fix modals' minimising-resuming-closing in some conditions

readme-update
Simon Grim 9 years ago
parent
commit
b0c2bacb15
  1. 4
      js/interface_common.js

4
js/interface_common.js

@ -154,7 +154,7 @@ function minimizeModal(modal, switchMode) {
twister.modal[i].scroll = scroll; twister.modal[i].scroll = scroll;
twister.modal[i].btnResume = $('<li>' + modal.find('.modal-header h3').text() + '</li>') twister.modal[i].btnResume = $('<li>' + modal.find('.modal-header h3').text() + '</li>')
.on('click', {hashString: window.location.hash}, function (event) { .on('click', {hashString: window.location.hash}, function (event) {
if (event.button === 0) // click may be catched not only on left mouse button in some browsers if (!event.button) // only if left mouse (button is 0) or elem.click() (button is undefined)
resumeModal(event); resumeModal(event);
}) })
.on('mouseup', {route: window.location.hash, blankOnly: true}, routeOnClick) .on('mouseup', {route: window.location.hash, blankOnly: true}, routeOnClick)
@ -852,7 +852,7 @@ function loadModalFromHash() {
if (twister.modal[i] && twister.modal[i].minimized) { if (twister.modal[i] && twister.modal[i].minimized) {
// need to close active modal(s) before btnResume.click() or it will be minimized in resumeModal() // need to close active modal(s) before btnResume.click() or it will be minimized in resumeModal()
// e.g. for case when you click on profile link in some modal having this profile's modal minimized already // e.g. for case when you click on profile link in some modal having this profile's modal minimized already
closeModal(true); closeModal(undefined, true);
twister.modal[i].btnResume.click(); twister.modal[i].btnResume.click();
return; return;
} }

Loading…
Cancel
Save