summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/view/Serializable.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-11-01 19:02:50 +0100
committerJules Laplace <julescarbon@gmail.com>2019-11-01 19:02:50 +0100
commit1becc513c36e30ffe7cc967613485fa39d05f203 (patch)
treea47c359b44df36f822553cd66ddd8f0ebc88cb34 /StoneIsland/www/js/lib/view/Serializable.js
parentc75e4f0b5fc83548e337af6c533036baec8c85c9 (diff)
v1.2.5
Diffstat (limited to 'StoneIsland/www/js/lib/view/Serializable.js')
-rwxr-xr-xStoneIsland/www/js/lib/view/Serializable.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js
index 3181fddd..08802fa9 100755
--- a/StoneIsland/www/js/lib/view/Serializable.js
+++ b/StoneIsland/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)