diff options
author | Struan Donald <struan@exo.org.uk> | 2013-08-20 12:36:23 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-08-20 12:36:23 +0100 |
commit | dd5bd6793c68eead57c799da374c19b3ddc04b2d (patch) | |
tree | 71798ff31970dc48c61c553b67a3cb388db19495 | |
parent | 0ed3b9c073fb5d7d03c24dcc3918a8958124dead (diff) |
Only call content hide before displaying page
Previously the content hiding code was also called when you left either
of the text fields which meant that when you e.g. dimissed the keyboard
the page content vanished.
Fixes #103
-rw-r--r-- | src/js/views/offline.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/js/views/offline.js b/src/js/views/offline.js index f4453a1..ff28e4b 100644 --- a/src/js/views/offline.js +++ b/src/js/views/offline.js @@ -9,7 +9,7 @@ events: { 'pagehide': 'destroy', - 'pagebeforeshow': 'toggleNextButton', + 'pagebeforeshow': 'beforeShow', 'pageshow': 'afterDisplay', 'vclick .ui-btn-left': 'onClickButtonPrev', 'vclick .ui-btn-right': 'onClickButtonNext', @@ -38,8 +38,12 @@ $('div[data-role="content"]').show(); }, - toggleNextButton: function() { + beforeShow: function() { $('div[data-role="content"]').hide(); + this.toggleNextButton(); + }, + + toggleNextButton: function() { if ( this.draftHasContent() ) { $('#offline-next-btn .ui-btn-text').text('Save'); } else { |