summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js b/StoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js
index de5fe951..4155f102 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/view/Serializable.js
@@ -70,8 +70,9 @@ var SerializableView = View.extend({
update_select: function(e){
var $target = $(e.currentTarget), value = $target.val()
var label = $target.find("option").filter(function(){ return this.value === value }).html()
- $target.parent().addClass("picked")
- $target.parent().find("span").html(label)
+ var $parent = $target.parent()
+ $parent.addClass("picked").removeClass("error_hilite")
+ $parent.find("span").html(label)
},
update_date: function(e){
@@ -103,9 +104,18 @@ var SerializableView = View.extend({
console.log("showing errors")
console.log(errors)
var msgs = []
+ this.$('.error_hilite').removeClass('error_hilite')
errors.forEach(function(e, i){
- if (i > 0) { return }
- this.$("[name=" + e[0] + "]").addClass('error_hilite')
+ // if (i > 0) { return }
+ if (e[0]) {
+ var $el = this.$("[name=" + e[0] + "]")
+ var el = $el[0]
+ if (el && el.nodeName === 'SELECT') {
+ $el.parent().addClass('error_hilite')
+ } else {
+ $el.addClass('error_hilite')
+ }
+ }
msgs.push(e[1])
}.bind(this))
this.$msg.html(msgs.join("<br>"))