mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-23 01:20:11 +00:00
fix scrolling on modals spawned by settings modal, fix getUsers cache
closing the settings modal to immediately open another caused the 'modal-open' class on the body to get deleted, which meant scrolling stopped working inside them. Also fix mistake added to jfapi in last commit.
This commit is contained in:
parent
410c35c844
commit
802f957d22
@ -136,6 +136,10 @@
|
|||||||
.settingIcon {
|
.settingIcon {
|
||||||
margin-left: 0.2rem;
|
margin-left: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.modal-open {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>Admin</title>
|
<title>Admin</title>
|
||||||
</head>
|
</head>
|
||||||
@ -404,10 +408,23 @@
|
|||||||
<script>
|
<script>
|
||||||
{{ if .bs5 }}
|
{{ if .bs5 }}
|
||||||
function createModal(id, find = false) {
|
function createModal(id, find = false) {
|
||||||
|
let modal;
|
||||||
if (find) {
|
if (find) {
|
||||||
return bootstrap.Modal.getInstance(document.getElementById(id));
|
modal = bootstrap.Modal.getInstance(document.getElementById(id));
|
||||||
|
} else {
|
||||||
|
modal = new bootstrap.Modal(document.getElementById(id));
|
||||||
}
|
}
|
||||||
return new bootstrap.Modal(document.getElementById(id));
|
document.getElementById(id).addEventListener('shown.bs.modal', function () {
|
||||||
|
document.body.classList.add("modal-open");
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
modal: modal,
|
||||||
|
show: function() {
|
||||||
|
let temp = this.modal.show();
|
||||||
|
return temp
|
||||||
|
},
|
||||||
|
hide: function() { return this.modal.hide(); }
|
||||||
|
};
|
||||||
}
|
}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
let send_to_addess_enabled = document.getElementById('send_to_address_enabled');
|
let send_to_addess_enabled = document.getElementById('send_to_address_enabled');
|
||||||
@ -419,9 +436,13 @@
|
|||||||
multiUseEnabled.classList.remove('form-check-input');
|
multiUseEnabled.classList.remove('form-check-input');
|
||||||
}
|
}
|
||||||
function createModal(id, find = false) {
|
function createModal(id, find = false) {
|
||||||
|
$('#' + id).on('shown.bs.modal', function () {
|
||||||
|
document.body.classList.add("modal-open");
|
||||||
|
});
|
||||||
return {
|
return {
|
||||||
show: function() {
|
show: function() {
|
||||||
return $('#' + id).modal('show');
|
let temp = $('#' + id).modal('show');
|
||||||
|
return temp
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
return $('#' + id).modal('hide');
|
return $('#' + id).modal('hide');
|
||||||
|
3
jfapi.go
3
jfapi.go
@ -224,7 +224,6 @@ func (jf *Jellyfin) getUsers(public bool) ([]map[string]interface{}, int, error)
|
|||||||
if public {
|
if public {
|
||||||
url := fmt.Sprintf("%s/users/public", jf.server)
|
url := fmt.Sprintf("%s/users/public", jf.server)
|
||||||
data, status, err = jf._get(url, nil)
|
data, status, err = jf._get(url, nil)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
url := fmt.Sprintf("%s/users", jf.server)
|
url := fmt.Sprintf("%s/users", jf.server)
|
||||||
data, status, err = jf._get(url, jf.loginParams)
|
data, status, err = jf._get(url, jf.loginParams)
|
||||||
@ -237,7 +236,7 @@ func (jf *Jellyfin) getUsers(public bool) ([]map[string]interface{}, int, error)
|
|||||||
jf.cacheExpiry = time.Now().Add(time.Minute * time.Duration(jf.cacheLength))
|
jf.cacheExpiry = time.Now().Add(time.Minute * time.Duration(jf.cacheLength))
|
||||||
return result, status, nil
|
return result, status, nil
|
||||||
}
|
}
|
||||||
return jf.userCache, status, nil
|
return jf.userCache, 200, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (jf *Jellyfin) userByName(username string, public bool) (map[string]interface{}, int, error) {
|
func (jf *Jellyfin) userByName(username string, public bool) (map[string]interface{}, int, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user