2013-05-23 08:12:01 +03:00
|
|
|
'use strict';
|
2013-07-14 10:00:50 +03:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'marionette',
|
|
|
|
'Mixins/AsModelBoundView'
|
|
|
|
], function (Marionette, AsModelBoundView) {
|
|
|
|
var view = Marionette.ItemView.extend({
|
|
|
|
template: 'Settings/General/GeneralTemplate',
|
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
2013-05-23 08:12:01 +03:00
|
|
|
|