@ -268,17 +268,21 @@ $(document).ready(function() {
function setupSetting ( ) {
function setupSetting ( ) {
if ( ajaxify . data . template [ 'account/settings' ] && ! document . getElementById ( 'persona:menus:legacy-layout' ) ) {
if ( ajaxify . data . template [ 'account/settings' ] && ! document . getElementById ( 'persona:menus:legacy-layout' ) ) {
$ ( '<div class="well checkbox"><label><input type="checkbox" id="persona:menus:legacy-layout"/><strong>Switch which side each mobile menu is on</strong></label></div>' )
require ( [ 'translator' ] , function ( translator ) {
. appendTo ( '#content .account > .row > div:first-child' )
translator . translate ( '[[persona:mobile-menu-side]]' , function ( translated ) {
. find ( 'input' )
$ ( '<div class="well checkbox"><label><input type="checkbox" id="persona:menus:legacy-layout"/><strong>' + translated + '</strong></label></div>' )
. prop ( 'checked' , Storage . getItem ( 'persona:menus:legacy-layout' , 'true' ) )
. appendTo ( '#content .account > .row > div:first-child' )
. change ( function ( e ) {
. find ( 'input' )
if ( e . target . checked ) {
. prop ( 'checked' , Storage . getItem ( 'persona:menus:legacy-layout' , 'true' ) )
Storage . setItem ( 'persona:menus:legacy-layout' , 'true' ) ;
. change ( function ( e ) {
} else {
if ( e . target . checked ) {
Storage . removeItem ( 'persona:menus:legacy-layout' ) ;
Storage . setItem ( 'persona:menus:legacy-layout' , 'true' ) ;
}
} else {
Storage . removeItem ( 'persona:menus:legacy-layout' ) ;
}
} ) ;
} ) ;
} ) ;
} )
}
}
}
}