mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Moved source code under src folder - massive change
This commit is contained in:
61
src/UI/Settings/General/GeneralView.js
Normal file
61
src/UI/Settings/General/GeneralView.js
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/General/GeneralTemplate',
|
||||
|
||||
events: {
|
||||
'change .x-auth': '_setAuthOptionsVisibility',
|
||||
'change .x-ssl': '_setSslOptionsVisibility'
|
||||
},
|
||||
|
||||
ui: {
|
||||
authToggle : '.x-auth',
|
||||
authOptions: '.x-auth-options',
|
||||
sslToggle : '.x-ssl',
|
||||
sslOptions: '.x-ssl-options'
|
||||
},
|
||||
|
||||
onRender: function(){
|
||||
if(!this.ui.authToggle.prop('checked')){
|
||||
this.ui.authOptions.hide();
|
||||
}
|
||||
|
||||
if(!this.ui.sslToggle.prop('checked')){
|
||||
this.ui.sslOptions.hide();
|
||||
}
|
||||
},
|
||||
|
||||
_setAuthOptionsVisibility: function () {
|
||||
|
||||
var showAuthOptions = this.ui.authToggle.prop('checked');
|
||||
|
||||
if (showAuthOptions) {
|
||||
this.ui.authOptions.slideDown();
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.authOptions.slideUp();
|
||||
}
|
||||
},
|
||||
|
||||
_setSslOptionsVisibility: function () {
|
||||
|
||||
var showSslOptions = this.ui.sslToggle.prop('checked');
|
||||
|
||||
if (showSslOptions) {
|
||||
this.ui.sslOptions.slideDown();
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.sslOptions.slideUp();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
Reference in New Issue
Block a user