mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Cleaned up auth settings
This commit is contained in:
@@ -1,10 +1,43 @@
|
||||
'use strict';
|
||||
define(['marionette', 'Mixins/AsModelBoundView'], function (Marionette, AsModelBoundView) {
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/General/GeneralTemplate'
|
||||
}
|
||||
);
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/General/GeneralTemplate',
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
events: {
|
||||
'change .x-auth': '_setAuthOptionsVisibility'
|
||||
},
|
||||
|
||||
ui: {
|
||||
authToggle : '.x-auth',
|
||||
authOptions: '.x-auth-options'
|
||||
},
|
||||
|
||||
|
||||
onRender: function(){
|
||||
if(!this.ui.authToggle.prop('checked')){
|
||||
this.ui.authOptions.hide();
|
||||
}
|
||||
},
|
||||
|
||||
_setAuthOptionsVisibility: function () {
|
||||
|
||||
var showAuthOptions = this.ui.authToggle.prop('checked');
|
||||
|
||||
if (showAuthOptions) {
|
||||
this.ui.authOptions.slideDown();
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.authOptions.slideUp();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user