aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/details_extra.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/views/details_extra.js')
-rw-r--r--www/js/views/details_extra.js17
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);
+ }
}
})
});