mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 18:41:59 -07:00
Allow #editIgnores to scroll in browser (fixes #2041)
class modal-open is applied to <body>, which ultimately means that the browser will scoll to the modal's content. However, #editFolder was finishing its close animation (and removing this modal-open class) after #editIgnores had set modal-open (and had started its open animation). The end result is that <body> ends up without modal-open when #editIgnores is open, and so the browser doesn't properly scroll. Instead, only open the #editIgnores once #editFolder has finished closing.
This commit is contained in:
parent
8fab7ec5e3
commit
8f38e83aaf
@ -1230,18 +1230,20 @@ angular.module('syncthing.core')
|
|||||||
.success(function (data) {
|
.success(function (data) {
|
||||||
data.ignore = data.ignore || [];
|
data.ignore = data.ignore || [];
|
||||||
|
|
||||||
$('#editFolder').modal('hide');
|
$('#editFolder').modal('hide')
|
||||||
|
.one('hidden.bs.modal', function() {
|
||||||
var textArea = $('#editIgnores textarea');
|
var textArea = $('#editIgnores textarea');
|
||||||
|
|
||||||
textArea.val(data.ignore.join('\n'));
|
textArea.val(data.ignore.join('\n'));
|
||||||
|
|
||||||
$('#editIgnores').modal()
|
$('#editIgnores').modal()
|
||||||
.on('hidden.bs.modal', function () {
|
.one('hidden.bs.modal', function () {
|
||||||
$('#editFolder').modal();
|
$('#editFolder').modal();
|
||||||
})
|
})
|
||||||
.on('shown.bs.modal', function () {
|
.one('shown.bs.modal', function () {
|
||||||
textArea.focus();
|
textArea.focus();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
$('#editIgnoresButton').removeAttr('disabled');
|
$('#editIgnoresButton').removeAttr('disabled');
|
||||||
|
Loading…
Reference in New Issue
Block a user