This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/lib/mobile.js

24 lines
420 B
JavaScript

/**
An object that is responsible for logic related to mobile devices.
@namespace Discourse
@module Mobile
**/
Discourse.Mobile = {
mobileView: false,
init: function() {
var $html = $('html');
this.mobileView = $html.hasClass('mobile-view');
},
toggleMobileView: function() {
if (localStorage) {
localStorage.mobileView = !this.mobileView;
}
window.location.reload();
}
};