diff options
author | Dave Arter <davea@mysociety.org> | 2018-04-26 21:35:23 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-30 13:18:58 +0100 |
commit | 5d0687f4c91643045fd724d1c31ba304b8d362ae (patch) | |
tree | f708faca2ee740b1d226c67b20f5999cfc0238c1 /www/js | |
parent | d9f13390ceb93fde2be1c00599a1841a1fa94a11 (diff) |
Allow scrolling on extra details screen
Adapted from zurich_mobile 374d5e4.
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/details_extra.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/www/js/views/details_extra.js b/www/js/views/details_extra.js index 734a27e..a516562 100644 --- a/www/js/views/details_extra.js +++ b/www/js/views/details_extra.js @@ -19,16 +19,19 @@ afterRender: function() { this.populateFields(); + this.enableScrolling(); }, onClickButtonPrev: function(e) { e.preventDefault(); + this.disableScrolling(); this.model.set('hasExtras', 0); this.updateCurrentReport(); this.navigate( this.prev, true ); }, onClickButtonNext: function() { + this.disableScrolling(); this.clearValidationErrors(); var valid = 1; var that = this; @@ -50,6 +53,8 @@ this.clearValidationErrors(); this.updateCurrentReport(); this.navigate( this.next ); + } else { + this.enableScrolling(); } }, @@ -103,6 +108,18 @@ this.$('input').each(populate); this.$('select').each(populate); this.$('textarea').each(populate); + }, + + disableScrolling: function() { + if ( typeof cordova !== 'undefined' ) { + cordova.plugins.Keyboard.disableScroll(true); + } + }, + + enableScrolling: function() { + if ( typeof cordova !== 'undefined' ) { + cordova.plugins.Keyboard.disableScroll(false); + } } }) }); |