diff options
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/view/Serializable.js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/view/Serializable.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js index 3181fddd..08802fa9 100755 --- a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js +++ b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js @@ -104,6 +104,7 @@ var SerializableView = View.extend({ console.log("showing errors") console.log(errors) var msgs = [] + this.$('.err_heading').addClass('error_visible') this.$('.error_hilite').removeClass('error_hilite') this.$('.err').html('') errors.forEach(function(e, i){ @@ -114,6 +115,9 @@ var SerializableView = View.extend({ if (el && el.nodeName === 'SELECT') { $el.parent().addClass('error_hilite') $el.parent().next('.err').html(e[1]) + } else if (el && el.type === 'date') { + $el.parent().addClass('error_hilite') + $el.parent().next('.err').html(e[1]) } else { $el.addClass('error_hilite') $el.next('.err').html(e[1]) @@ -123,6 +127,9 @@ var SerializableView = View.extend({ }.bind(this)) // this.$msg.html(msgs.join("<br>")) this.$msg.addClass('alert-notice') + if (app.view.scroller) { + app.view.scroller.scrollTo(0, 0) + } }, hide_errors: function(){ @@ -137,6 +144,8 @@ var SerializableView = View.extend({ save: function(e){ e && e.preventDefault() + this.$('.err_heading').removeClass('error_visible') + var valid = this.validate() if (valid.errors.length) { this.show_errors(valid.errors) |
