[fix] Close modals when user clicks both on pad inner and outer

Also: split tests for automatic reconnection and regular modal tests.
This commit is contained in:
Luiza Pagliari 2017-05-04 11:22:18 -03:00
parent 0bd4169663
commit 4eec3763b4
3 changed files with 72 additions and 14 deletions

View file

@ -3367,7 +3367,12 @@ function Ace2Inner(){
evt.preventDefault();
}
}
//hide the dropdownso
hideEditBarDropdowns();
}
function hideEditBarDropdowns()
{
if(window.parent.parent.padeditbar){ // required in case its in an iframe should probably use parent.. See Issue 327 https://github.com/ether/etherpad-lite/issues/327
window.parent.parent.padeditbar.toggleDropDown("none");
}
@ -4983,6 +4988,8 @@ function Ace2Inner(){
$(document).on("keypress", handleKeyEvent);
$(document).on("keyup", handleKeyEvent);
$(document).on("click", handleClick);
// dropdowns on edit bar need to be closed on clicks on both pad inner and pad outer
$(outerWin.document).on("click", hideEditBarDropdowns);
// Disabled: https://github.com/ether/etherpad-lite/issues/2546
// Will break OL re-numbering: https://github.com/ether/etherpad-lite/pull/2533
// $(document).on("cut", handleCut);