|
|
@ -4706,9 +4706,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
var confirmShown = false; |
|
|
|
var confirmShown = false; |
|
|
|
|
|
|
|
|
|
|
|
function switchLayout(mobile) { |
|
|
|
function switchLayout(mobile) { |
|
|
|
|
|
|
|
ConfigStorage.noPrefix(); |
|
|
|
Storage.set({ |
|
|
|
Storage.set({ |
|
|
|
current_layout: mobile ? 'mobile' : 'desktop', |
|
|
|
layout_selected: mobile ? 'mobile' : 'desktop', |
|
|
|
layout_confirmed: {width: $(window).width(), mobile: mobile} |
|
|
|
layout_width: $(window).width() |
|
|
|
}).then(function () { |
|
|
|
}).then(function () { |
|
|
|
AppRuntimeManager.reload(); |
|
|
|
AppRuntimeManager.reload(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -4719,28 +4720,25 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var width = $(window).width(); |
|
|
|
var width = $(window).width(); |
|
|
|
if (!e && Config.Mobile && width <= 800) { |
|
|
|
var newMobile = width < 600; |
|
|
|
|
|
|
|
if (!width || |
|
|
|
|
|
|
|
!e && (Config.Navigator.mobile ? width <= 800 : newMobile)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var newMobile = width < 600; |
|
|
|
|
|
|
|
if (newMobile != Config.Mobile) { |
|
|
|
if (newMobile != Config.Mobile) { |
|
|
|
Storage.get('layout_confirmed').then(function (result) { |
|
|
|
ConfigStorage.noPrefix(); |
|
|
|
if (result && |
|
|
|
Storage.get('layout_width').then(function (confirmedWidth) { |
|
|
|
(result.mobile |
|
|
|
if (width == confirmedWidth) { |
|
|
|
? width == result.width |
|
|
|
|
|
|
|
: width == result.width |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
confirmShown = true; |
|
|
|
confirmShown = true; |
|
|
|
ErrorService.confirm({ |
|
|
|
ErrorService.confirm({ |
|
|
|
type: newMobile ? 'SWITCH_MOBILE_VERSION' : 'SWITCH_DESKTOP_VERSION' |
|
|
|
type: newMobile ? 'SWITCH_MOBILE_VERSION' : 'SWITCH_DESKTOP_VERSION' |
|
|
|
}).then(function () { |
|
|
|
}).then(function () { |
|
|
|
Storage.remove('layout_confirmed'); |
|
|
|
|
|
|
|
switchLayout(newMobile); |
|
|
|
switchLayout(newMobile); |
|
|
|
}, function () { |
|
|
|
}, function () { |
|
|
|
Storage.set({layout_confirmed: {width: width, mobile: Config.Mobile}}); |
|
|
|
ConfigStorage.noPrefix(); |
|
|
|
|
|
|
|
Storage.set({layout_width: width}); |
|
|
|
confirmShown = false; |
|
|
|
confirmShown = false; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|