diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-10 17:15:14 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-10 17:15:14 +0200 |
| commit | 2fb2e09bb24340a7cc33ae30037f45125791131c (patch) | |
| tree | 45afccf7b9455ab48f7725a24bae5c28ad02ca9e /StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js | |
| parent | 6196541cf993d5a1a4b8b7f511bf7daf8f849608 (diff) | |
androidz
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js')
| -rwxr-xr-x | StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js new file mode 100755 index 00000000..90ace549 --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js @@ -0,0 +1,45 @@ +var SettingsView = FormView.extend({ + + el: "#settings", + + events: { + "change [name=store]": "changeStore", + "change [name=hub]": "changeHub", + }, + + initialize: function(){ + this.$form = this.$(".form") + this.$msg = this.$(".msg") + this.$store = this.$("[name=store]") + this.$hub = this.$("[name=hub]") + this.scroller = new IScroll('#settings', app.iscroll_options) + }, + + show: function(){ + if (! auth.logged_in()) { return app.router.go("intro") } + if (! navigator.onLine) { + app.closed.showElement() + app.closed.setMessage("PLEASE GO ONLINE TO CHANGE<br>YOUR NOTIFICATION SETTINGS.", "") + return + } + document.body.className = "settings" + this.deferScrollToTop() + + this.$store.prop("checked", !! push.settings.store) + this.$hub.prop("checked", !! push.settings.hub) + // push.subscribe("store") + // push.subscribe("hub") + }, + + changeStore: function(){ + var state = app.settings.$store.prop("checked") + if (state) { push.subscribe("store") } + else { push.unsubscribe('store') } + }, + changeHub: function(){ + var state = app.settings.$hub.prop("checked") + if (state) { push.subscribe("hub") } + else { push.unsubscribe('hub') } + }, + +})
\ No newline at end of file |
